Results 1 to 8 of 8
  1. #1

    Vertical Expandable Menu

    Hi All
    I usually post in the Video Forum but I currently have a web problem.
    I did a website for a client with a little expandable Javascript Menu that shows 2 submenu levels. (This actually is included with Namo Web Editor 6) It works fine BUT the client wants to change the operation as follows.

    If you expand the menu to say, access, a sub-menu and then click to go to another page, he wants the whole menu to stay expanded so the user can, have quick access to all the sub menus until they close the sub menus. My current one compresses everything to level one the moment you link an item!!

    Anyone know of a Javascript expandable menu that will NOT close up after you click a link

    Many thanks

    Chris

  2. #2
    Administrator Dave's Avatar
    Join Date
    Sep 2004
    Location
    Te Awamutu, New Zealand
    Posts
    3,959
    Blog Entries
    79
    This is technically possible but it won't be easy. The problem is that when a user clicks a link and leaves the page, any JavaScript that is currently running gets lost and the new page starts from scratch. There is no way to leave the menu open unless you use frames (yuck, bad idea).

    The only option I can see is to "send" a variable from one page to the next. When the menu is open you would record a variable that describes the menu's present state. When the user clicks a link and visits a new page, that variable is retrieved and the menu is reconstructed as it was.

    How to do that? Two ways I know of:
    (1) Pass the variable as a query string in the URL
    (2) Store the variable as a cookie

    Both of these approaches are problematic. Before I go any further, are you still keen to proceed?
    Dave Owen
    MediaCollege.com

  3. #3
    Hi Dave
    Many thanks as usual!!
    I will convince the client that it's problematic...I actually found a tree version that uses cookies but it's problematic as you say. and frames are painful!!! His original staff member who designed the site has left the company.

    What he basically has is a site with a group of products and a menu on each page which expands to show each product page. If you have a moment look at :
    http://www.sietronics.com.au

    He wants to be able to choose a product from a "manufacturer" and once at that product page, he wants the menu to reflect all the products from the manufacturer so the user can see other products in the same group.

    It's not really a big deal..if there is nothing simple I can just make a "fake" menu on each product page using text links which will work fine. However if you can think of any other way then it would be appreciated

    PS: The menu is mis-aligned too!! I'm waiting for the files to change that!!

    Chris

  4. #4
    Administrator Dave's Avatar
    Join Date
    Sep 2004
    Location
    Te Awamutu, New Zealand
    Posts
    3,959
    Blog Entries
    79
    Ah yes, I see what he's after. This should actually be possible without too much drama but it will take a bit of effort. Unfortunately I'm going to be very busy for the next few days but I'll try to pop in ASAP and see if I can give a better answer, if you're still keen.
    Dave Owen
    MediaCollege.com

  5. #5
    Hi Dave
    Not to worry if you are busy!!
    I can just use the menu on the main page then make "dummy" expanded menus with a bunch of images in a little table for the "expanded" menus and link each image. A little bit of graphic work but probably a lot easier than coding and cookies and then it will be cross browser compatible too!!
    Since he never wants the expanded menus to close an image of the actual menu will be pretty simple !!
    Hmmm video is a lot easier than this but it's for a mate!!

    Your input is much appreciated!!

    Chris

  6. #6
    You could possibly (I haven't looked at the code) create a method for having each of the possible menus default show and having each page have a setting for that variable, so if you are ever on page X, when it loads menu 7 is showing. This may cause issue if you have a page that is accessible via two different menus but many sites do this and you could simply choose the one that it better fits with.
    Eric Adler (tonsofpcs)
    http://www.videoproductionsupport.com/ Chat at: http://tinyurl.com/vpschat
    Follow me on twitter: @videosupport @eric_adler

  7. #7
    Administrator Dave's Avatar
    Join Date
    Sep 2004
    Location
    Te Awamutu, New Zealand
    Posts
    3,959
    Blog Entries
    79
    Yep, the main point is that you don't actually have to "remember" what the user clicked because each page's menu state will always be the same for that page. That makes it a lot easier. Basically any method that opens the correct menu state for each page would be fine.

    One method I've used is to parse the page URL and create the menu based on the folder structure implied by the URL. It's a bit much to explain here but it works well if the file structure is consistent.

    If you want to go about it the completely manual way you could simply create each page's menu separately using tables or CSS.
    Dave Owen
    MediaCollege.com

  8. #8
    Quote
    Quote: Dave
    View Post
    One method I've used is to parse the page URL and create the menu based on the folder structure implied by the URL. It's a bit much to explain here but it works well if the file structure is consistent.
    There's actually ways to do this without a folder-based file structure (but making it seem as though it is) through some Apache tricks (which may or may not work on other httpds).
    Eric Adler (tonsofpcs)
    http://www.videoproductionsupport.com/ Chat at: http://tinyurl.com/vpschat
    Follow me on twitter: @videosupport @eric_adler

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
  •  
Subscribe to us on YouTube