mobile - jquery preventdefault on first touch only -
i'm hoping learn way code following touch only, using jquery?
$(".portfolio a").one("click", false);
this code hover
event on visual menu link. i'd prevent link following through on first touch, hover event happens on first touch, , second touch takes through link.
hover class tied href...
just test touch behaviour before unbinding link once:
if ("ontouchstart" in document.documentelement) { $(".portfolio a").one("click", false, function(e){ e.preventdefault(); } }
or vice versa
$(".portfolio a").one("click", false, function(e){ if ("ontouchstart" in document.documentelement) { e.preventdefault(); } }
Comments
Post a Comment