Would there be any way to detect the tap at the push of a button? The code works fine on the desktop , but when I test in mobile does not fire.
Using JqueryMobile is not an option.
var timeout = 0;
$('button').mousedown(function() {
timeout = setTimeout(menu_toggle, 2000);
}).bind('mouseup mouseleave', function() {
clearTimeout(timeout);
});
function menu_toggle() {
alert('ok');
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button>pressionar</button>