Open nickfmc opened 9 years ago
There is the close method
So something like $("#mainbodyelement").click(function () { $("#my-menu").slicknav('close') }); will close the menu - this is what i use and it works.
It's a nice script, but needs a little more polish, I like that it works with IE8+ but I use JQuery Mobile and when I add the scripts and Css file for JQM on the page, SlickNav will not work, it won't even show up.
Anyone encounter this problem? I only use JQM for the Panels that can slide in and out of the sides.
That is what I was trying basically symeonb however because my trigger is inside the #mainbodyelement when I click to open the menu it closes right away because its firing both scripts.
ragscoon please don't hijack threads, start a new issue if you are looking for help.
ahh yes - my menu is actually outside of the #mainbodyelement - you would have to determine somehow if you are opening the menu or not, and then either close it or not - perhaps the .init callback can help in this instance.
Sorry wan't meaning to hijack anything. I used the "close" click feature on a DIV element that comes just inside the body tag and is a wraper for the entire page, so far this works well, but I am also trying to figure out how to add the click function to all the anchor tags in the menu so that when a link is clicked, the menu closes after. I know that if your are moving from page to page the close on click function is not needed, but what if you need it for a link that does not lead from one page to the next?
Never mind that last post, I found the CloseOnClick feature in the Javascript set to false, once its set to true the menu closes on click of the anchor tags.
I tried a couple different ways without luck. Is there a way to trigger the close callback when you click anywhere on the (body) that isn't the menu. so that clicking anything except a menu item closes the menu