SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    May 2010
    0 Post(s)
    0 Thread(s)

    Expanding drop down menu

    I'm working on a website that will have a left-hand navigation showing the major departments of the site. When a visitor clicks on a department link, it will show that link and a sub-menu of pages below it.

    In other words, they'd initially see:

    Department A
    Department B
    Department C

    Then, let's say they click on the Department A link. Then they'd see:

    Department A
    Page 1
    Page 2
    Page 3
    Department B
    Department C

    I'm told that this is done with HTML with if/else statements added to show the sub-menus.

    I haven't worked with if/else statements for a while, and was wondering if you'd mind refreshing my memory on how to implement them.

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Melbourne, AU
    460 Post(s)
    8 Thread(s)
    Normally you'd do that with JavaScript. Here are two online examples by Stu Nichols:

    Stu has all sorts of menus on show, such as:


Posting Permissions

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