JQuery Mobile按钮的颜色不会改变颜色
问题描述:
我创建了一个包含三个选项卡按钮的小型JQuery移动应用程序,其中一个按钮用于访问不同的页面。通过使用预先配置的data-theme =“a”,当按下按钮并加载相关页面时,按下的按钮变为蓝色。这是第一次点击该按钮,但当再次点击该按钮以再次访问同一页面(来自另一页面)时,该按钮不会再次变成蓝色,但仍为深灰色。有谁知道这个问题的解决方案可能在哪里? 下面给出了其中一个页面的代码,作为演示。在此先感谢JQuery Mobile按钮的颜色不会改变颜色
<div data-role="page" data-theme="b" id="chart">
<div data-role="header" data-position="fixed" data-fullscreen="true" class="headerBar" data-theme="a">
<a href="#busstat" data-icon="arrow-l" data-iconpos="left" data-transition="slide" data-direction="reverse" class="back-button">Back</a>
<div align="center" style="vertical-align:middle; margin-top:10px; margin-bottom:10px;">
Cars
</div>
</div>
<div data-role="content" data-fullscreen="true" style="width:100%; height:100%;">
<div id="container" class="container"></div>
</div>
<div data-role="footer" data-position="fixed" data-fullscreen="true" class="footerBar">
<div data-role="navbar">
<ul>
<li><a href="#chartYear" data-role="tab" class="ui-btn-active footer-button" data-transition="slideup" >Last Year</a></li>
<li><a href="#chartMonth" data-role="tab" class="footer-button" data-transition="slideup">Last Month</a></li>
<li><a href="#charWeek" data-role="tab" class="footer-button" data-transition="slideup">Last 7 Days</a></li>
</ul>
</div>
</div>
</div>
答
添加类的UI状态,坚持'以选定的选项卡不工作:
<li><a href="#chartYear" data-role="tab" class="ui-btn-active footer-button ui-state-persist" data-transition="slideup" >Last Year</a></li>
你能提供一个小提琴? – Nelson 2013-03-08 15:41:46
只给我几分钟.. – Anto 2013-03-08 15:43:37
由于这是一个CSS问题,CSS肯定会有所帮助。 – 2013-03-08 16:13:46