Welcome to WebmasterWorld Guest from 50.17.79.100

Forum Moderators: open

Message Too Old, No Replies

javascript drop down menu

drop down menu

     

cdcaveman

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

5+ Year Member



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./?

RonPK

8:33 am on Sep 8, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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>');
</script>

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

 

Featured Threads

Hot Threads This Week

Hot Threads This Month