I am trying to make a solution for yoga laptops(the ones that support both, click and touch). I have multilevel navigation where submenus are displayed on hover, however on these laptops you can touch/tap menu and I get click event which loads link set on top menu item that is clicked and does not display submenus. If I try to recognize if touch is supported using modernizr and preventDefault on clikc - on some standart(mouse controled) laptops it creates this bug that top level navigation item becomes unclickable.
So what I am looking for is to write function that would execute preventDefault only on tap/touch and not click. I have this code to prevent default, but it seems to be ignored by touch and still acts up like click on these yoga laptops:
$(".multi-level .inner-link").on("tap",function (e) {
event.stopPropagation();
e.preventDefault ? e.preventDefault() : event.returnValue = false;
});
Any suggestions or links would be big help.