0

Am trying to find a way to minimize my ui with smartways of navigation on desktop and mobile devices. What is the best solution to replace mousedown in mobil devices http://codepen.io/shaikeomra/pen/XKNBVX

$(document).mouseup(function(e){
    if(mouse_down) {
    //
    mouse_down = false;
    $("#header").animate({height: 46},300);
    $("#menu").removeClass("show");
    $(".pullmenu-icon").removeClass("hide");
    //
OmRa
  • 1
  • 1

1 Answers1

0

vmousedown - this is from the jQuery Mobile documentation:

"...allows the developer to register listeners for the basic mouse events, such as mousedown, mousemove, mouseup, and click, and the plugin will take care of registering the correct listeners behind the scenes to invoke the listener at the fastest possible time for that device."

https://api.jquerymobile.com/vmousedown/

EDIT: i would not replace the event handling, as modern devices can have both, a mouse attached and touch screen, but rather follow the hint described in this other SO answer:

How to bind both Mousedown and Touchstart, but not respond to both? Android, JQuery

Community
  • 1
  • 1
deblocker
  • 7,629
  • 2
  • 24
  • 59