简体   繁体   中英

jQuery Mobile refresh page after changePage

Is there anyway to force a jQm page to reload once changePage is complete?

I have a number of pages dynamically loaded into an array. All of the pages that are being loaded are a part of a list, for example "20 mobile apps of 2011". Users will need to have the ability to swipe left and right to navigate the pages.

I've added the current code here: http://jsfiddle.net/cncpts/qMe6Z/2/

Notice how the URL's are being pulled from the array. From this i'm able to pull the next URL and the previous URL but I am only able to navigate one page forward and one back.

You can test the page here by clicking then swiping the mouse left or right: http://www.cncpts.me/complex/swipe/index.php

Any ideas on how to get the URL's to refresh while maintaining the native JQM transitions.

Why don't you use the JQM pagaintion plugin ? Should be exactly what you are looking for.

If you want to change the URL you will have to set the changehash option to true in order for it to change

 $.mobile.changePage(next,{
      changeHash:true,
      reloadPage:true,
      dataUrl:next
      });

Here is the link to the demo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM