本文介绍了导航按钮上的jquery mobile force ui-btn-active的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了jQuery移动导航(导航栏)的问题。

I am having a problem with jQuery mobile navigation (navbar).

我有4页,我设置了class =ui-btn-active每页上的另一个..

I have 4 pages and I've set the class="ui-btn-active" to a different one on each page..

例如:

Page 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页:

then if you go to page 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 -->

等...

我的问题是因为它并不总是突出显示,有时我必须按两次按钮才能高亮显示。

My problem is that it's not always highlighting and sometimes I have to press the button 2 times for it to hightlight.

有没有人知道如何强制这个工作?

Does anyone have a clue on how to force this to work?

推荐答案

尝试将ui-state-persist类添加到锚点。
ex:class =ui-btn-active ui-state-persist

Try adding the "ui-state-persist" class to your anchor. ex: class="ui-btn-active ui-state-persist"

这篇关于导航按钮上的jquery mobile force ui-btn-active的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 11:39