gpt4 book ai didi

jquery - 更改 jquerymobile 上的自定义导航栏图标

转载 作者:行者123 更新时间:2023-12-03 22:51:45 26 4
gpt4 key购买 nike

尚未找到更改具有多个页脚的页面上的自定义导航栏图标的解决方案。

这就是我目前使用的:

    $(".live_menu .ui-icon").css("background","url(/btn_on.gif) !important");
$(".live_menu .ui-icon").css("background-repeat","no-repeat !important");

有什么想法吗?

最佳答案

相关:

实例:

Custom Icons

To use custom icons, specify a data-icon value that has aunique name like myapp-email and the button plugin will generate aclass by prefixing ui-icon- to the data-icon value and apply it to thebutton. You can then write a CSS rule that targets theui-icon-myapp-email class to specify the icon background source. Tomaintain visual consistency, create a white icon 18x18 pixels saved asa PNG-8 with alpha transparency.

JS:

$('#custom-li-1').click(function() {
$(this).attr('data-icon','star');
$(this).children().children().next().removeClass('ui-icon-custom').addClass('ui-icon-star');
}).page();

$('#custom-li-2').click(function() {
$(this).attr('data-icon','home');
$(this).children().children().next().removeClass('ui-icon-grid').addClass('ui-icon-home');
}).page();

$('#custom-li-3').click(function() {
$(this).attr('data-icon','grid');
$(this).children().children().next().removeClass('ui-icon-star').addClass('ui-icon-grid');
}).page();

HTML:

<div data-role="page" id="home">
<div data-role="header" data-theme="b">
<h1>Test</h1>
</div>
<div data-role="content" data-theme="d">
<div data-role="navbar" data-theme="d">
<ul id="custom-nav-list">
<li><a href="#" data-icon="custom" class="ui-btn-active" id="custom-li-1">Home</a></li>
<li><a href="#" data-icon="grid" id="custom-li-2">Second page</a></li>
<li><a href="#" data-icon="star" id="custom-li-3">Third page</a></li>
</ul>
</div>
</div>

</div>

关于jquery - 更改 jquerymobile 上的自定义导航栏图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6902259/

26 4 0