Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-04-2013, 12:58 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 event should not work on desktop?

Hello,

So, I have the jQuery mobile swipe working on tablets and phones which is good. But it also fires on the desktop with a mouse swipe. This means that a user cannot highlight text. I thoguth this was something that would only work on mobile devices.

How can I fix this?

Code:
$(document).ready(function(){	  

	var path = getModuleDataUrl();
	$.get(path, function(xmlFile)
		{
			$.ajax({
				type: "GET",
				url: path,
				dataType: "text",
				success: parseXml
			});
	});
	
	$('#containerContainer').live("swipeleft", function(){
		goToNext();
 
	});

	$('#containerContainer').live("swiperight", function(){
		goToPrev();
	 
	 });
	
});
m2244 is offline   Reply With Quote
Old 01-04-2013, 04:41 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,491
Thanks: 18
Thanked 361 Times in 360 Posts
sunfighter is on a distinguished road
m2244 take this with a bit of salt, because I do not program for mobile devices. I am pretty sure .live is depreciated and the .on should be used.
Neither here nor there. It appears that the problem is the selector. Maybe you need one that refers to a mobile device only. I did find this and do hope it works for you:
http://www.appmobi.com/amdocs/lib/jq...eat.pdf?r=6589
sunfighter is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:19 AM.


Advertisement
Log in to turn off these ads.