Dealing With Mouseenter And Mouseleave On The Ipad
I have a typical looking drop down menu that is hidden by default but by the following jQuery magic
Working example: http://jsfiddle.net/qgrt5/
Edit: The below code will now check if the user is coming from an iPad, and if they are, it will use the click
function instead of the mouseenter
var isiPad = navigator.userAgent.match(/iPad/i) != null;
if (isiPad) {
$(".navNew li").unbind('mouseenter mouseleave').bind('mouseenter mouseleave', function() {
$(this).toggleClass('hover');
});
}
else {
$(".navNew li").unbind('mouseenter mouseleave').bind('mouseenter mouseleave', function() {
$(this).toggleClass('hover');
});
}
Post a Comment for "Dealing With Mouseenter And Mouseleave On The Ipad"