CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   jquery mobile swipe issue (still works on desktop) (http://www.codingforums.com/showthread.php?t=287937)

m2244 02-19-2013 07:56 PM

jquery mobile swipe issue (still works on desktop)
 
Hello,

I have a swipe function that works alright but the problem is that if you go back on to your desktop computer and do a quick swipe with the mouse (probably wouldn't happen very often in the real world) you get a swipe event. This is annoying!

So, now I am wondering if I can use jQuery to detect the width of the screen and ignore the swipe if the width is above say 1024px.

Any advice?

Code:

$('#containerContainer').live("swipeleft", function(){
                alert("In swipe left.");
                goToNext();
});


$('#containerContainer').live("swiperight", function(){
                goToPrev();
});



All times are GMT +1. The time now is 10:58 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.