467,894 Members | 1,580 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,894 developers. It's quick & easy.

i need help - questions about javascript and collapsible menu

hi,

i am a beginner when it comes to javascript, i would like to have a menu (see examples 1 and 2 below), that folds out to reveal sub links, pushing the other menu items down – and then springs back in place if you either

1.click on the main link again (STAFF in example 1)or
2. if you click on a different main link(STAFF, CAREERS or INTERNSHIP) (i think you know what i am talking about – just a boring moving menu)



example 1

STAFF

jane

john

etc

CAREERS

INTERNSHIPS

--------------------------------------

example 2

STAFF

CAREERS

work here

send cv

INTERNSHIPS

anyway, i know that i can save some of the javascript in a seperate .js file and link to it in the header, and i can save the style elements in my css sheet, but my dilema is that the items in the menu are bound to change, for example under staff – if someone clicks, all the staff names should appear below, but if i have to add a new staff member i would have to change every single page to include that new member as a link....

so in fact, what i want to do is put the actual link and menu skeleton in a js file or some other sort of file and then just place a scr in the html text (do you know what i mean)

does anyone have any ideas? i am sorry if this seems like a silly question, but i am just learning.



my site is

www.visionandvalue.com



i am talking about the grey menu running down the left hand side of the page (if you click on “people” it would be clear).



thanks for your help!



leah
Mar 20 '07 #1
  • viewed: 1146
Share:
1 Reply
sicarie
Expert Mod 4TB
hi,

i am a beginner when it comes to javascript, i would like to have a menu (see examples 1 and 2 below), that folds out to reveal sub links, pushing the other menu items down – and then springs back in place if you either

1.click on the main link again (STAFF in example 1)or
2. if you click on a different main link(STAFF, CAREERS or INTERNSHIP) (i think you know what i am talking about – just a boring moving menu)



example 1

STAFF

jane

john

etc

CAREERS

INTERNSHIPS

--------------------------------------

example 2

STAFF

CAREERS

work here

send cv

INTERNSHIPS

anyway, i know that i can save some of the javascript in a seperate .js file and link to it in the header, and i can save the style elements in my css sheet, but my dilema is that the items in the menu are bound to change, for example under staff – if someone clicks, all the staff names should appear below, but if i have to add a new staff member i would have to change every single page to include that new member as a link....

so in fact, what i want to do is put the actual link and menu skeleton in a js file or some other sort of file and then just place a scr in the html text (do you know what i mean)

does anyone have any ideas? i am sorry if this seems like a silly question, but i am just learning.



my site is

www.visionandvalue.com



i am talking about the grey menu running down the left hand side of the page (if you click on “people” it would be clear).



thanks for your help!



leah
I'm betting if you asked a pointed question about your attempt at creating that menu in the Javascript forum (JavaScript, not Java - on the right hand side), someone there would be able to help you.
Mar 20 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by books1999 | last post: by
reply views Thread by madhur | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.