Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery-Mobile swipe doesn't work when you start on an anchor tag

I have swipeleft/swiperight working well in my app but when the user does the mousedown over an anchor tag, the swiping action is not triggered.

How can I make the swipe work even when the user does the mousedown on an anchor tag?

EDIT: It looks like this is only an issue in browsers on computers - tablets work fine.

like image 852
Eric Avatar asked Apr 11 '12 01:04

Eric


2 Answers

You can swipe with the normal left button in any modern browser on the desktop.

Make sure you prevent the default action on the dragstart event on your div.

$("div").bind('dragstart', function(event) {event.preventDefault(); });

I have a working copy here...

http://jsfiddle.net/38nXe/

like image 80
Trent Avatar answered Sep 22 '22 15:09

Trent


You can swipe on a desktop browser using the right mouse button. It is not very elegant as it also opens the context menu. But it works everywhere. Alex

like image 20
Alex Avatar answered Sep 23 '22 15:09

Alex