Hide menu after click?

Post your questions and problem reports here.
Post Reply
mattadata
Posts: 5
Joined: Thu Aug 21, 2014 8:11 pm

Hide menu after click?

Post 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!
User avatar
Aivars
Blumentals Software Developer
Posts: 2462
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Hide menu after click?

Post by Aivars »

If you're using JavaScript to load URL to iframe then you can call:

EBMMMenu.hide()
Blumentals Software Programmer
mattadata
Posts: 5
Joined: Thu Aug 21, 2014 8:11 pm

Re: Hide menu after click?

Post 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>
User avatar
Aivars
Blumentals Software Developer
Posts: 2462
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Hide menu after click?

Post 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.
Blumentals Software Programmer
mattadata
Posts: 5
Joined: Thu Aug 21, 2014 8:11 pm

Re: Hide menu after click?

Post 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
User avatar
Aivars
Blumentals Software Developer
Posts: 2462
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Hide menu after click?

Post by Aivars »

Can you put it somewhere online and send me a link?
Blumentals Software Programmer
mattadata
Posts: 5
Joined: Thu Aug 21, 2014 8:11 pm

Re: Hide menu after click?

Post by mattadata »

Yes, I will PM you the link.
User avatar
Aivars
Blumentals Software Developer
Posts: 2462
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Hide menu after click?

Post by Aivars »

I replied you in PM the solution.
Blumentals Software Programmer
mattadata
Posts: 5
Joined: Thu Aug 21, 2014 8:11 pm

Re: Hide menu after click?

Post by mattadata »

That solved the issue. Thanks for your help!
garch9
Posts: 1
Joined: Mon Dec 13, 2021 3:03 pm

Re: Hide menu after click?

Post by garch9 »

i am having the same problem how can i say
if you want a link nadkuantum.com
User avatar
Aivars
Blumentals Software Developer
Posts: 2462
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Hide menu after click?

Post 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.
Blumentals Software Programmer
Post Reply