Search code examples
jqueryjquery-mobilephotoswipe

Photoswipe swipe controls on touch screens without jquery mobile


I have a page for an image gallery where I am using http://www.photoswipe.com/ to go between images in the gallery. Everything works perfectly, except on mobile devices it does not recognize swipe gestures without the jquery mobile library. I don't like using jquery mobile because it does too many of its own things with styling, adding stuff I don't want, etc.

The example I'm basing it off is here. Basically trying to use this exact same page except without using jquery mobile: http://www.gregoryjewellers.com.au/libraries/jquery/photoswipe/examples/04-jquery-mobile.html#Gallery1. Except my photoswipe call is just:

$(document).ready(function(){
    var myPhotoSwipe = $("#Gallery a").photoSwipe({ enableMouseWheel: true , enableKeyboard: true , preventDefaultTouchEvents: true });
});

Is there any way to implement Photoswipe with touch screen gestures without jquery mobile? If so, is there an example out there?


Solution

  • The thing is PhotoSwipe is built on top of jQuery Mobile library. jQuery Mobile is activating on links and divs having data-role="page" attribute. mostly you might be messing with links(anchor tags). If so use rel="external" in links.