Skip to content

Instantly share code, notes, and snippets.

@FlorianX
Created September 25, 2011 09:50
Show Gist options
  • Save FlorianX/1240428 to your computer and use it in GitHub Desktop.
Save FlorianX/1240428 to your computer and use it in GitHub Desktop.
.changePage() changes page, but reloads previous page for a second
<script>
$(document).ready(function(){
$("#pageone").bind("swipeleft", function(event,ui){
$.mobile.changePage($("#pagetwo"));
})
$("#pagetwo").bind("swiperight", function(event,ui){
$.mobile.changePage($("#pageone"));
})
});
</script>
[...]
<div data-role="page" data-theme="b" id="pageone">
<div data-role="content" id="content1">
FIRST PAGE
</div><!-- /content -->
</div><!-- /page -->
<div data-role="page" data-theme="b" id="pagetwo">
<div data-role="content" id="content2">
SECOND PAGE
</div><!-- /content -->
</div><!-- /page -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment