Results 1 to 3 of 3

Thread: Need help putting two expandable menus on one page

  1. #1
    Join Date
    Sep 2006

    Need help putting two expandable menus on one page

    Hey guys,

    I was wondering if anyone could help me out with this javascript problem that I am having.

    I have successfully added this "Click-To-Expand Menu" onto my website that I am developing. It works perfectly and everything looks good.

    However, I want to add an additional, separate menu a little bit lower down on the same page that also clicks to expand.

    The problem is that the Javascript puts an "id" in there as "containerul". When I put another menu onto that same page, it doesn't work because both of those menus need to share that same "id" as "containerul".

    Does anyone know how to set it so that I can use the same javascript so that I can have two separate click-to-expand menus on one page?

    I'd really appreciate your help.

    Last edited by narz; 09-12-2006 at 11:04 AM.

  2. #2
    Join Date
    Sep 2006
    Oops, I forgot to point out that the javascript I am using comes from this site:


  3. #3
    Join Date
    Sep 2006
    You should be able to use two scripts but you will need to change the ID to something else on one of them. The ID is used in the HTML tag so that when the script searches through it can find that "container".

    Just change the ID in your HTML, search through the script and look for getElementById("containerul"). I think it's only used a few times.

    This may not fix your problem though, as the script also stores the "states" of the menu in a cookie. You may also need to change the cookie that one script uses, otherwise one being open will be read as them both being open...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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