jQuery superfish menu / hover on iPad, iPhone etc
I am using the jQuery Superfish plugin on a website I am working on. Works fine so far.
Problem is: I have to optimize the site for mobile devices like iPad etc.
After I click开发者_高级运维 on a menu item the menu doesn't close itself as long as I click any other link on the page.I have tried looking at the Superfish code and changing hover events to click
events but without success.
I am not a pro when it comes to jQuery, so I would appreciate if anyone could help me out what I need to change to make this stuff work.
try this
//ipad and iphone fix
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
$("ul.sf-menu").bind('click',function() {
$('ul.sf-menu').hideSuperfishUl();
});
}
just add this to you document.ready hope it will help..
精彩评论