Trying to have multiple mobile.changePage

Trying to have multiple mobile.changePage

Hi!

I'm making a gallery, fullscreen. 
I want the user to able to swipe right and left on multiple pages, and on each page I got an image. 

Using this code seen below.
When I just take out "firstpage" and "secondpage" the code stops working and no swipes are registered. 




  1. $( function() {

  2.   $('body').bind("swipeleft", function(){
  3.   $.mobile.changePage('firstpage');
  4.    });  

  5.   $('body').bind("swiperight", function(){
  6.   $.mobile.changePage('secondpage');
  7.    });  

  8. } );
How do I get so that I can swipe right and left on every page? Without targeting each one like seen above

Kind regards
    • Topic Participants

    • anton