-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Menus all open if hidden by a media query on superfish.init() #113
Comments
Interesting find. I'll keep it in mind when working on the next release. Thanks. |
I did solve this. I set the .style property of the offending div to display: block, call superfish.init(), and immediately hide it again. There is no flash because javascript doesn't return to the browser during this operation. Sometimes it causes an error message on IE8, which we deal with by returning if .style is null or undefined. |
I believe that if you comment out line 141 in superfish.js, namely this: ... it will work fine |
I've seen this issue when there is an iframe on the page. The full menu tree is expanded when you first hover over a menu item, the fix suggested by raduGaspar seems to work. |
I'm just wary that the fix suggested by @raduGaspar may cause other bugs. I remember I added that code for a reason. |
When exactly does a browser "grow"? Is this a realistic scenario (e.g. happens when changing device orientation on iPad)? If not, seems like an implementation concern to me. FYI - #158 (comment) |
When you resize a desktop browser. It could happen when you rotate your ipad, sure. |
We are facing this issue in IE11 only and is there any plans for releasing official fix? |
If superfish.init() is called when the superfish menu is hidden (as by a media query setting display: none) then the hide() method opens all of the menus. When the browser grows to a size that is intended to show the superfish menu then all of the dropdowns are open and shown.
I noticed that the hide method calls $ul.show() and then $ul.stop(true, true) to attempt to instantly re-hide the menu. I'm not clear on why it does this, but it looks like something about the $ul.stop() call does not work when the menu is display: none.
The text was updated successfully, but these errors were encountered: