Jump to content

Hide Menu


Springs_Goth

Recommended Posts

Hi all, i searched for this topic and couldnt find anything, so any help would be greatly appreciated!!!!My site is ATORLEY. That is the address, purely for demonstration and to help me, then ill take it off. I wish to make the Navigation on the right hide certain elements when others are clicked.As you can see the navigation has "about us" underneath that i wish to write, Vision & Mission. BUT These must only show once about us has been selected. Then when another say Contact Us has been selected the Vision and Mission must hide, and something like e-mail must be shown.Do you understand? Can anyone help me? Currently i am not running much Javascript on the page...but i know that i can make this an external file and place a link to it.

Link to comment
Share on other sites

Yes, execpt once lunch is selected Breakfast and Dinner must disapear, and viceversa. Also i see in the script,

<a href="javascript:toggleMenu('menu3')">DINNER</a>

that is the link to the JavaScript. However can i still link it to another link as well? Say with

two href:=""

????

Link to comment
Share on other sites

No, one anchor can only link to one other something (anchor, document, script,..). But you can give the anchor a main link, and the attribute onclick="" to define the javascript for several script functions, instead of only one.Example:

<a href="/Click_here_to_execute_several_things"  onclick="toggleMenu('menu1'); toggleMenu('menu2'); toggleMenu('menu3'); return false">Click Here</a>
Notice the ; return false instruction at the end of the onclick attribute, which deactivates the main link defined in the href attribute :) Edited by Dan The Prof
Link to comment
Share on other sites

Yes, execpt once lunch is selected Breakfast and Dinner must disapear, and viceversa.
Yes that's possible, just add to the code that all menu's are hidden first then show the one that is clicked.
Also i see in the script, 
<a href="javascript:toggleMenu('menu3')">DINNER</a>

that is the link to the JavaScript. However can i still link it to another link as well? Say with

two href:=""

????

change it around to this.<a href="www.google.com" onclick="java script:toggleMenu('menu3')">DINNER</a><br />
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...