www.webdeveloper.com
Results 1 to 2 of 2

Thread: stopPropagation(); doesn't work on touch devices

Hybrid View

  1. #1
    Join Date
    Jul 2013
    Posts
    1

    stopPropagation(); doesn't work on touch devices

    Hi,
    i have built a mobile Navigation and this is the js code:
    Code:
    $('.show').click( function(e){
    e.stopPropagation();
    $('#mobile').slideToggle(500);
    });
    
    $(document).click( function(){
    $('#mobile').hide();
    });
    On my computer it works perfect. But the problem is that the stopPropagation(); on touch devices don't work.
    Have anyone a solution?
    Thank you!

  2. #2
    Join Date
    Jun 2008
    Posts
    106
    Is the event even firing on the touch device? Try this...

    Code:
    $('.show').on('touchstart click', function (e) {
        e.stopPropagation();
        $('#mobile').slideToggle(500);
    });
    
    $(document).on('touchstart click', function () {
        $('#mobile').hide();
    });

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles