Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

javascript drop down menu

drop down menu

12:32 am on Sep 8, 2008 (gmt 0)

Junior Member

5+ Year Member

joined:June 18, 2008
posts: 58
votes: 0

when our page loads, the navigation tree drop down menu is open and then immedately closes . any body know why or have a work around./?
8:33 am on Sept 8, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 22, 2002
votes: 0

Hard to tell without seeing the code, so this is just a wild guess. By default the menu is displayed in full. When the page has finished loading, a script is called that closes the submenus. The good thing about this setup is that users without javascript get a usable menu too.

The solution might be to add a script to the head of the page that writes out a piece of css, which sets the display-property of the submenus to 'none'. Example:

<script type="text/javascript"> 
document.write('<style type="text/css">ul.submenu {display: none;}</style>');

This way js-challenged users still get to see the full menu.