4

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.

ziesemer
  • 27,712
  • 8
  • 86
  • 94
maze
  • 215
  • 2
  • 5
  • 9
  • I had the same issue I just wrote the script with jquery without the superfish plugin. I don't even understand what is so special about super fish. – Neo Jun 07 '12 at 23:48

1 Answers1

5

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..

mrrsb
  • 663
  • 3
  • 13
  • 28
  • I tried with this code. The menu was collapsed only when I tap on the image . It does not collapsed when I tap on the other place of the screen and dropdown arrow menu. Am I wrong something? Please help me. – May Phyu Dec 17 '16 at 10:42