Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2012
    Posts
    137
    Thanks
    1
    Thanked 1 Time in 1 Post

    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();
    	 
    	 });
    	
    });

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,712
    Thanks
    25
    Thanked 660 Times in 659 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •