Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript CLOSED: Jquery.mobile and custom touch events

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #148187
    will_wallace85
    Participant

    EDIT

    And, as always, 30 seconds later I figured it out. It was some custom jQuery in a seperate file that was causing the conflict. Just started turning things on and off till I figured out what was cuasing the issue, problem solved

    /EDIT

    Inherited a jquery.mobile site and tried to add my own touch event for off screen navigation so I don’t have to get grab the panels plugin. It works fine on all desktop browsers click events, but doesn’t seem to trigger on touch events at all. Here’s the jQuery:

        $(".nav-toggle").bind('touchend mouseup', function(e){
            e.stopPropagation();
            e.preventDefault();
            if($(this).hasClass('open')){
                $(this).removeClass('open');
                $(this).css("top", "0");
                $(".main-nav").css("height", "0");
            } else {
                var eleheight = $("#menu-front-menu").height();
                $(this).addClass('open');
                $(this).css("top", eleheight);
                $(".main-nav").css("height", eleheight);
            }
        });
    

    I’ve tried all the touch handlers, just using click() instead of a bind, and alerted out a test at the very beginning of the function just to see if maybe it was an error. My best guess at this point is either the item isn’t tappable for some reason, or jquery.mobile is hijacking touch events and re purposing them in a way I haven’t found in their docs.

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.