Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Turn off swipe left/right on iPad image gallery

Status
Not open for further replies.

Diggum1

Programmer
Oct 14, 2004
67
0
0
US
I created a quick gallery website using jquery Responsive Image Gallery (
It works fine in a desktop browser, but when viewing the gallery on an ipad, if I try to pinch to zoom (or touch the image in any way), the gallery automatically advances to the next slide. This makes it impossible to zoom into an image on an iPad. I'd like to turn off that functionality.

Link to JS file:

Any ideas?

Thanks!
Rick
 
from a very brief code-review it looks like you need to turn off the wipeLeft and wipeRight custom events that attach to the touchWipe class

it's difficult to inject this code into mobile browsers to try it out, so this is not tested.
Code:
if( ! /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) { //might need to include something for windoze fones too? 
 $imgWrapper.touchwipe({
  wipeLeft: function() { _navigate( 'right' );},
  wipeRight: function() { _navigate( 'left' );}
 },
 preventDefaultEvents: false
 });
}
 
just in case it's not obvious - this is replacement code for the relevant section of the script. not an additional script.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top