gpt4 book ai didi

jquery-ui - 用超赞字体扩展jQuery UI图标

转载 作者:行者123 更新时间:2023-12-03 13:23:56 25 4
gpt4 key购买 nike

我想要一种使用Font-Awesome图标扩展默认jQuery UI图标的方法。如果可能的话,请保留jQuery图标作为备用,因为Font-Awesome尚无法完全覆盖。

jQuery UI示例:

$("#muteAll").button({
text: false,
icons: {
primary: "ui-icon-volume-on"
}
});


字体超赞替换/扩展示例:

$("#muteAll").button({
text: false,
icons: {
primary: "icon-volume-up"
}
});


我想出的最接近的是:

.ui-icon[class*=" icon-"] {
background: none repeat scroll 0 0 transparent;
left: 0;
margin-left: 1px;
text-indent: 0;
}

最佳答案

带有注释的股票jQuery的最终解决方案:

/* Allow Font Awesome Icons in lieu of jQuery UI and only apply when using a FA icon */
.ui-icon[class*=" icon-"] {
/* Remove the jQuery UI Icon */
background: none repeat scroll 0 0 transparent;
/* Remove the jQuery UI Text Indent */
text-indent: 0;
/* Bump it up - jQuery UI is -8px */
margin-top: -0.5em;
}

/* Allow use of icon-large to be properly aligned */
.ui-icon.icon-large {
margin-top: -0.75em;
}

.ui-button-icon-only .ui-icon[class*=" icon-"] {
/* Bump it - jQuery UI is -8px */
margin-left: -7px;
}


演示 jsfiddle

关于jquery-ui - 用超赞字体扩展jQuery UI图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17459115/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com