jquery mobile force ui-btn-active on navbar button
jquery mobile force ui-btn-active on navbar button
我在jQuery移动导航(导航栏)方面遇到了问题。
我有 4 个页面,我已经将 class="ui-btn-active" 设置为每页上的不同页面。
例如:
页 1:
<div data-role="footer">
<div data-role="navbar">
<ul>
<li><a href="index.html" data-icon="home" data-iconpos="top" class="ui-btn-active">Page 1</a></li>
<li><a href="index2.html" data-icon="plus" data-iconpos="top">Page 2</a></li>
<li><a href="index3.html" data-icon="grid">Page 3</a></li>
<li><a href="index4.html" data-icon="star" data-iconpos="top">Page 4</a></li>
</ul>
</div><!-- /navbar -->
然后,如果您转到第 2 页:
页 1:
<div data-role="footer">
<div data-role="navbar">
<ul>
<li><a href="index.html" data-icon="home" data-iconpos="top">Page 1</a></li>
<li><a href="index2.html" data-icon="plus" data-iconpos="top" class="ui-btn-active">Page 2</a></li>
<li><a href="index3.html" data-icon="grid">Page 3</a></li>
<li><a href="index4.html" data-icon="star" data-iconpos="top">Page 4</a></li>
</ul>
</div><!-- /navbar -->
</div><!-- /footer -->
等。。。
我的问题是它并不总是突出显示,有时我必须按 2 次按钮才能突出显示。
有没有人知道如何强制它工作?
尝试将"ui-state-persist"类添加到锚点。例如:class="ui-btn-active ui-state-persist"
将
活动按钮上的链接设置为href=#
似乎为我解决了这个问题。
尽管您已经在该页面上,但单击活动链接时似乎存在问题,然后离开该页面并返回该页面。
您必须将
"ui-state-persist"添加到所有锚标记中,否则,如果您刷新页面,然后转到另一个页面,然后返回您刷新的页面,它仍然会中断。
这
仅适用于我(在 v1.3 中),如果我在我想突出显示的锚标签上设置 class="ui-btn-active ui-state-persist"(即,每页一个),其余的锚标签在该导航栏中没有设置类。
相关文章:
- javascript button target_blank?
- 获取打开jquery对话框的button的id
- javascript button ajax and php
- 模拟<按钮>在<asp:button>
- CKJustify和Color Button插件之间的不兼容
- jQuery[button.class]未检测到用按钮追加行
- Webiopi multiple button css
- button.单击两次删除附加操作后不工作
- 如何停止向上滚动<按钮dojoType=“;dijit.form.Button”;type=“;提交”/>在
- getDocument by id/get input text from button dons'不起作用
- javascript页面加载发生在Button Click上
- Bootstrap Navbar滚动后品牌发生变化
- react native renderRow with button:将rowData推到按钮函数
- ASP/C#-未触发UpdatePanel和Button OnClick事件
- 如何通过 Button 在 materializecss 中发送值
- HTML Button and href prbolem
- 在 Google Plus Button 上跟踪 click() 事件
- jQuery UI不会加载到.button的$(“#content”).load页面上
- 无法调试此Navbar子导航幻灯片
- jquery mobile force ui-btn-active on navbar button