Hide menu after click?

Post your questions and problem reports here.

Hide menu after click?

Postby mattadata » Thu Aug 21, 2014 8:45 pm

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!
mattadata
 
Posts: 5
Joined: Thu Aug 21, 2014 8:11 pm

Re: Hide menu after click?

Postby Aivars » Thu Aug 21, 2014 10:45 pm

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

EBMMMenu.hide()
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 1957
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Hide menu after click?

Postby mattadata » Thu Aug 21, 2014 11:16 pm

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

Re: Hide menu after click?

Postby Aivars » Fri Aug 22, 2014 9:49 am

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

Re: Hide menu after click?

Postby mattadata » Fri Aug 22, 2014 5:54 pm

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

Re: Hide menu after click?

Postby Aivars » Mon Aug 25, 2014 11:12 am

Can you put it somewhere online and send me a link?
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 1957
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Hide menu after click?

Postby mattadata » Mon Aug 25, 2014 3:12 pm

Yes, I will PM you the link.
mattadata
 
Posts: 5
Joined: Thu Aug 21, 2014 8:11 pm

Re: Hide menu after click?

Postby Aivars » Mon Aug 25, 2014 4:52 pm

I replied you in PM the solution.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 1957
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Hide menu after click?

Postby mattadata » Tue Aug 26, 2014 6:04 am

That solved the issue. Thanks for your help!
mattadata
 
Posts: 5
Joined: Thu Aug 21, 2014 8:11 pm


Return to Easy Button & Menu Maker Support

Who is online

Users browsing this forum: No registered users and 1 guest