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
-
Solution 1:
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 themouseenter
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'); }); }
You may like these posts
- Jquery Embedded Quote In Attribute
- How To Ensure That The Hibernate Version Number Stays Immutable In A Javascript Client?
- Send Message To Background Page, Update The Html, And Then Show It In A Tab
- Using Regex To Check Name,10 Digit Mobile Number And A 12 Digit Number Using Ng-blur And Match Function In Angularjs
Post a Comment for "Dealing With Mouseenter And Mouseleave On The IPad"