muncken Posted February 24, 2010 Share Posted February 24, 2010 Hi,I have designet a menu tree class that outputs a menu with optional submenus available. When submenus (childs) are added to a menu link (parent), a submenu div will pop up when clicking the parent link. I use a simple javascript combined with css style.display property that checks the current style of the submenu; if block, set display to none and if none, set display to block.That works brilliant in FF and Safari etc. (as usual), but when it comes to IE, it crashes. I am experiencing serious troubles trying to fix this very IE-bug.All relevant css and html can be viewed here: http://test.muncken.dk/test_menu.phpThanks,Kasper Link to comment Share on other sites More sharing options...
Err Posted February 24, 2010 Share Posted February 24, 2010 Run your webpage through an html validator and fix your HTML errors, it might be contributing to your problem. Also, instead of using: <ul> <li><a class="menuParent" href="java script:toggleSubmenu('submenu_1');" title="Parent 1">Parent 1</a> <div class="menuSubmenu" id="submenu_1" style="display:none;"> <li><a class="menuChild" href="?id=1⊂=1" title="Child 1.1">Child 1.1</a></li> <li><a class="menuChild" href="?id=1⊂=2" title="Child 1.2">Child 1.2</a></li> <li><a class="menuChild" href="?id=1⊂=3" title="Child 1.3">Child 1.3</a></li> </div> </li></ul> Nest the unordered list correctly, and use the second parent <li> instead of <div> to hide the child list. <ul> <li><a class="menuParent" href="java script:toggleSubmenu('submenu_1');" title="Parent 1">Parent 1</a></li> <li class="menuSubmenu" id="submenu_1" style="display:none;"> <ul> <li><a class="menuChild" href="?id=1⊂=1" title="Child 1.1">Child 1.1</a></li> <li><a class="menuChild" href="?id=1⊂=2" title="Child 1.2">Child 1.2</a></li> <li><a class="menuChild" href="?id=1⊂=3" title="Child 1.3">Child 1.3</a></li> </ul> </li></ul> Link to comment Share on other sites More sharing options...
muncken Posted February 25, 2010 Author Share Posted February 25, 2010 Thanks, RahXephon. To change the hidden area from a div to a li with a ul inside fixed my problem. Great and thanks again! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.