如果您在 JQuery Mobile 中有一个 ListView ,其 countbubbles 定义如下:
<ul data-role="listview">
<li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
<li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
<li><a href="index.html">Drafts <span class="ui-li-count">4</span></a></li>
<li><a href="index.html">Sent <span class="ui-li-count">328</span></a></li>
<li><a href="index.html">Trash <span class="ui-li-count">62</span></a></li>
</ul>
是否可以通过编程方式更改计数气泡计数的值?例如,您可以在链接/a href 中添加一个 id,然后使用
进行更改吗$('#exampleID').text('12');
?
最佳答案
是的,会的。这是一个在 5 秒后更新收件箱计数的简单示例。 http://jsfiddle.net/codaniel/h3vuv/1/
关于javascript - 以编程方式更改 Listview countbubble,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10562488/