问题
I have a personal project that shows some charts about my losing weight trophy. I created a page with jquery mobile just because I will use this application on my mobile. However I have some problems with jquery mobile and I could not figure it out.PROJECT DEMO
Problem is : When I click circle icon[TOP LEFT] which will trigger the left panel and and click workoutcharts page then please click CIRCLE IVAN DRAGO icon which will redirect you to again Main Page then click TOP LEFT Circle Icon again, then boom, it wont work and I could not figure it out.
I tried it on fiddle and it is working at all
<div data-role="page" id="firstPage">
<a href="#mypanel" class="ui-btn ui-shadow ui-corner-all ui-btn-icon-notext" ></a>
<div data-role="panel" id="mypanel" class="menuPanel">
<ul>
<li> <a href="#firstPage" >First Page</a></li>
<li> <a href="#secondPage" >Second Page</a></li>
</ul>
</div>
first Page
</div>
<div data-role="page" id="secondPage">
<a href="#mypanel" class="ui-btn ui-shadow ui-corner-all ui-btn-icon-notext" ></a>
<a href="#firstPage">First PAGE</a>
<div data-role="panel" id="mypanel" class="menuPanel">
<ul>
<li> <a href="#firstPage" >First Page</a></li>
<li> <a href="#secondPage" >Second Page</a></li>
</ul>
</div>
Second Page
</div>
回答1:
I notice that you have two divs, both with the same id "mypanel" -- that might be the cause of your problem
来源:https://stackoverflow.com/questions/24972261/jquery-mobile-button-is-not-working-at-second-click