Results 1 to 6 of 6

Thread: BLM Multi Level Menu

  1. #1
    Join Date
    Aug 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default BLM Multi Level Menu

    1) Script Title: BLM MultiLevel Menu

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamicindex1/blmmenu/

    3) Describe problem:
    When the page first loads, all of the sub-menus are visible. Once all of the items on the page have fully loaded, they dissapear.

    Sample:
    http://www.kydex.com/test/company_presidentsmessage.asp

    Is there any way to prevent this?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Probably several. The menu is designed to be useful without javascript enabled. That is why everything is visible before the script initializes. I didn't design this script but, I know that it doesn't have to be that way. My best guess for your menu (a horizontal one, right?) would be to put this script after the style links:

    Code:
    <script type="text/javascript">
    if(document.getElementById)
    document.write('<style type="text/css"> .horizontal li ul {display: none;} <\/style>');
    </script>
    That way, if javascript is present, the menus should be hidden at first without waiting for the script to load, and still be visible if javascript is disabled.

    I'm not certain if this is the solution (as I said, my best guess) but, if it isn't, it just needs to be changed so as to apply the right style to the right selector.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Sorry, I haven't been on the forums in a while. John's solution will work fine, but I just wanted to point out for anyone with the same problem that may find this thread that there is an easier solution. You just need to add "inaccesible" to the class portion of the top div. The css will pick it up and hide the sub menus right away. In the version on my site, this is now the default.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    But, will that preserve the non-javascript enabled utility of the menu?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    But, will that preserve the non-javascript enabled utility of the menu?
    It depends on which version. The version on DD, no. The way I have designed it, if javascript is turned off, then the submenus will still be hidden. That is why I had the feature turned off by default. So, in that regard your solution is better. However, in between when version on DD was written and when the new version was written, IE 7 was released. Since IE 7 allows :hover on all elements, I took advantage of this, and made the menu work completely without javascript(minus some advanced features). This allowed me to reverse the inacessible option into accessible, for those still worried about older browsers without javascript.

  6. #6
    Join Date
    Sep 2004
    Location
    Tallahassee, FL USA
    Posts
    264
    Thanks
    71
    Thanked 2 Times in 2 Posts

    Default

    Just added your code to my page and it works perfectly! Thanks, I didn't know that issue could be resolved.

    Do you know how I could style menu items that don't have hyperlinks? Here is my post with a site link and code: http://www.dynamicdrive.com/forums/s...ad.php?t=41816
    Thanks,
    Deborah
    Deborah Whipp
    Web Designer
    Tallahassee, FL
    www.DWWebDesigns.com

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
  •