SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Non-Member
    Join Date
    May 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    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
    Location
    Melbourne, AU
    Posts
    23,590
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    Normally you'd do that with JavaScript. Here are two online examples by Stu Nichols:

    http://www.stunicholls.com/menu/jquery-menutree.html
    http://www.stunicholls.com/menu/tree_frog_vertical.html

    Stu has all sorts of menus on show, such as:
    http://www.stunicholls.com/menu/
    http://www.cssplay.co.uk/menus/


Bookmarks

Posting Permissions

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