How do I change the code below to swipe to the next page/ the ‘to: url’ w/o having to write the script for every page change?
<script type="text/javascript">
$('div').live("swipeleft", function(){
$.mobile.changePage("#pg02", "slide", false, true);
});
$('div').live("swiperight", function(){
$.mobile.changePage("#pg01", "slide", true, true);
});
</script>
rename your pages to pg1 pg2, …, pg10 without the zeros in front
you will have to add some
ifs to guard first and last page.You might also want to put the now variable in some other object not in the global scope of window object.