The original post of is at http://stackoverflow.com/questions/23797331/using-swipe-gestures-to-change-pages-in-multi-page-jquery-mobile-application.
Note that because of minor differences, the code at http://jsfiddle.net/Gajotres/JB22E/3/ doesn't work. The code below is from the stackoverflow post and has been tested to work.