Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question HOw to create a row of expanding menus?

    I'm having trouble getting each column of expanding menus in the row to expand. It seems that the first column works find but the others do not. I through up an example at:

    http://www.awhurst.com/notworkin.html

    I'm a little perplexed.

    is there just a little bit of code to change or should i slap in copies of the java code in the <head> area with menu2, menu3, and menu4. But if I do that it doesn't work. Is there a way possibly to put all the actions into one event handler?

    Thanks to anyone who responds.

    Spunky844 out...

  • #2
    New to the CF scene
    Join Date
    Sep 2005
    Location
    Michigan
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    From what I'm seeing, I think your best bet would be to loop through the ul tags rather than just grabbing it by the id 'menu'.

    But I didn't spend too much time really looking at everything...

  • #3
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how do you do that?

    What would the looping code look like?

    loop

    end loop

    it's been a while since I took that java class.

  • #4
    New to the CF scene
    Join Date
    Sep 2005
    Location
    Michigan
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Something like...

    Code:
    var iList = document.getElementsByTagName("ul");
    for (u = 0; u < iList.length; u ++) {
    
    menus = iList.item(u);
    }
    So rather than calling document.getElementById("menu"), you would call iList.item(u) or iList[u]. Whichever you prefer.

    But remember, you would have to have any code using the document.getElementById("menu") to be inside of the loop.


    Hope this helps.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •