Vertical drop down menu ... how?

Discussion in 'CSS' started by snicher, Nov 18, 2007.

  1. #1
    I want to create a site with a header, a vertical drop down menu to the left, and some content.

    When clicking on a link in the menu, I can't refresh the entire page. This would reset the status of the drop down menu.

    So I will have to do one of the following:
    1) Have to use some modern alternative to frames.
    2) Let each page have its own static menu.

    Any ideas?
     
    snicher, Nov 18, 2007 IP
  2. davert

    davert Banned

    Messages:
    345
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I use a Javascript menu from www.burmees.nl/menu which has worked well. Very easy to include. If you just want a single line menu without dropdowns, it's easier to do it in CSS.
     
    davert, Nov 18, 2007 IP
  3. snicher

    snicher Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Looks like it is frame based. This might be a solution ... no, I just wont do frames ... unless I have to.

    What I want to is to create a drop down menu, which drops down: (not out to the right, but down)
    Sorta like this:

    Stuff
    Books
    - Momo
    - The Neverending Story
    - The Night of Wishes
    Movies
    Cars

    The problem is how I should keep the menu in its current status, after I have clicked the link.
     
    snicher, Nov 19, 2007 IP
  4. Tal_el

    Tal_el Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i join to the request
     
    Tal_el, Nov 19, 2007 IP
  5. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You're probably not going to like this, but you're most likely going to have to create the entire site as a single page, then hide everything but the current menu item's "contents" via JavaScript.

    I'm not at home, otherwise I'd post an example of what I mean.
     
    Dan Schulz, Nov 19, 2007 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #6
    I'd go with option 2, BUT, generate that menu server side in a SSI or CGI like php or ASP. Another approach would be to set a cookie in .js when the menu item is clicked that server side could figure out what the 'starting state' of the page would be.
     
    deathshadow, Nov 19, 2007 IP
  7. snicher

    snicher Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Dan Schulz: You're right, that might actually work .. But I don't want a vertical drop down menu *that* much!

    deathshadow: Really good idea. I think I go for PHP. Is is possible to detect the filename of the current page with PHP, or do I have to do something like $thepage = "we are at the link page"; to tell the menu what page we are at?
     
    snicher, Nov 20, 2007 IP
  8. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Ah, I see what you're after now. Sorry, I just happened to misunderstand what you were after. Thankfully you have far more options available than I previously thought (given my "understanding" of the question at the time).
     
    Dan Schulz, Nov 20, 2007 IP
  9. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #9
    basename($_SERVER['SCRIPT_FILENAME'])

    That should return the currently executing script's name.
     
    deathshadow, Nov 21, 2007 IP
  10. snicher

    snicher Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Thanks, things are working now! :)
     
    snicher, Nov 21, 2007 IP