Page 1 of 1

Hide menu after click?

PostPosted: Thu Aug 21, 2014 8:45 pm
by mattadata
I am using Easy CSS Menu. I have the links load into an iframe on the same page below the menu. Some of my menus are large and cover up the content when they are expanded. After clicking on a menu item that loads a link in the iframe, the menu doesn't hide....and it covers the content.

How do I make the menu auto hide after a link is clicked?

Thanks!

Re: Hide menu after click?

PostPosted: Thu Aug 21, 2014 10:45 pm
by Aivars
If you're using JavaScript to load URL to iframe then you can call:

EBMMMenu.hide()

Re: Hide menu after click?

PostPosted: Thu Aug 21, 2014 11:16 pm
by mattadata
Thanks! I am not using javascript to load the URLs, but I can change that.I know very little about javascript, I got the page to load, but where would I put the EBMMMenu.hide() function?

<li id="123" class="gradient_menuitem gradient31 first_item"><a href="http://example.com/page1.html" target="Articles" title="" onclick="replaceIframeURL('Articles', this.href); return false" >Page 1</a></li>

Re: Hide menu after click?

PostPosted: Fri Aug 22, 2014 9:49 am
by Aivars
When editing the menu in EBMM, in URL field put:

javascript:replaceIframeURL('Articles', this.href); EBMMMenu.hide();

The "javascript:" in front will tell EBMM that this is not simply an URL but script.

Re: Hide menu after click?

PostPosted: Fri Aug 22, 2014 5:54 pm
by mattadata
Just to be clear, I am using Easy CSS Menu 4.0, not EBMM. I couldn't get it to work in the tool, but I was able to manually adjust the HTML to call the hide function.
The hide function works, but the very next time I go to the menu, it drops down with the values pre-chosen from last time....and the 3rd level is on top of the second level.
I have included some screenshots of the way the menu looks during first click, and then second click after calling hide function. It doesn't look correct.
First click looks OK
Image
Subsequent clicks look wrong
Image

Re: Hide menu after click?

PostPosted: Mon Aug 25, 2014 11:12 am
by Aivars
Can you put it somewhere online and send me a link?

Re: Hide menu after click?

PostPosted: Mon Aug 25, 2014 3:12 pm
by mattadata
Yes, I will PM you the link.

Re: Hide menu after click?

PostPosted: Mon Aug 25, 2014 4:52 pm
by Aivars
I replied you in PM the solution.

Re: Hide menu after click?

PostPosted: Tue Aug 26, 2014 6:04 am
by mattadata
That solved the issue. Thanks for your help!

Re: Hide menu after click?

PostPosted: Tue Dec 14, 2021 9:42 am
by garch9
i am having the same problem how can i say
if you want a link nadkuantum.com

Re: Hide menu after click?

PostPosted: Fri Dec 17, 2021 10:59 am
by Aivars
They were using Javascript links instead of the regular links before. You could try doing the same:

Change links "page.html" to:
javascript:window.frames['koc'].location.assign('page.html');EBMMMenu.hide();

The first part will load the link in your iframe, the second part will close the menu.