View Single Post
Old 02-19-2013, 07:56 PM   PM User | #1
m2244
Regular Coder

 
Join Date: Jun 2012
Posts: 129
Thanks: 1
Thanked 1 Time in 1 Post
m2244 is an unknown quantity at this point
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();
});
m2244 is offline   Reply With Quote