homepage Welcome to WebmasterWorld Guest from 54.211.68.132
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
javascript drop down menu
drop down menu
cdcaveman

5+ Year Member



 
Msg#: 3740206 posted 12:32 am on Sep 8, 2008 (gmt 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./?

 

RonPK

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3740206 posted 8:33 am on Sep 8, 2008 (gmt 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>');
</script>

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved