SlickAU Posted August 23, 2007 Share Posted August 23, 2007 Hey dudes, I am in the final stages of finishing this drop down menu I have made using mainly div tags, javascript and css... It looks absolutely perfect in Firefox, but when you open it up in IE, the dropdown function does not work properly and the css doesn't kick in properly. ??? The Live address is: http://www.theslick.com/portfolio/v2 Here is the code for the page: <div id='topnav'> <div id="navcontainer"> <div id="navbox" onmouseover="dropdown('1')" onmouseout="drophide()">Application <div id="navdrop" onmouseover="dropdown('1')" onmouseout="drophide()"> <a href="database/" class="menuitem">Database</a> </div> <div id="navdrop1" onmouseover="dropdown('1')" onmouseout="drophide()"> <a href="#" class="menuitem">Frame Editor</a> </div> </div> <div id="navbox" onmouseover="dropdown('2')" onmouseout="drophide()">Websites <div id="navdrop2" onmouseover="dropdown('yes')" onmouseout="drophide()"> <a href="?p=websites" class="menuitem">View</a> </div> </div> <div id="navbox"><a href="?p=media" class="menuitem">Media</a> </div> <div id="navbox"><a href="?p=contact" class="menuitem">Contact</a></div> </div> </div> and here is the CSS: #topnav { margin:0; padding:0; height:20px; width:100%; background-color:#87c8fb; z-index:1; } #navcontainer { margin-left:220px; float:left; z-index:1; position:relative; height:20px; } #navbox { width:120px; height:17px; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; font-weight:bold; text-align:center; color:#FFFFFF; padding-top:2px; float:left; text-decoration:none; } #navbox:hover { background-color:#666666; border-bottom:1px solid #333333; border-top:1px solid #333333; color:#FFFFFF; } #navdrop { height:18px; width:120px; color:white; background-color:#87c8fb; padding-top:5px; margin-top:4px; visibility:hidden; } #navdrop:hover { color:#FFFFFF; background-color:#666666; } #navdrop1 { height:18px; width:120px; color:white; background-color:#87c8fb; padding-top:5px; border-bottom:1px solid #333333; visibility:hidden; } #navdrop1:hover { color:#FFFFFF; background-color:#666666; } #navdrop2 { height:18px; width:120px; color:white; background-color:#87c8fb; padding-top:5px; margin-top:4px; visibility:hidden; border-bottom:1px solid #333333; } #navdrop2:hover { color:#FFFFFF; background-color:#666666; } and finally the JS (its pretty simple...): <script language="javascript" type="text/javascript"> function dropdown(number) { if (number == "1") { document.getElementById("navdrop").style.visibility = "visible" document.getElementById("navdrop1").style.visibility = "visible" } else if (number =="2") { document.getElementById("navdrop2").style.visibility = "visible"; } } function drophide() { document.getElementById("navdrop").style.visibility = "hidden" document.getElementById("navdrop1").style.visibility = "hidden" document.getElementById("navdrop2").style.visibility = "hidden" } </script> Any help would be much appreciated.... Thanks Link to comment https://forums.phpfreaks.com/topic/66304-drop-down-menu-not-displaying-correctly-in-ie/ Share on other sites More sharing options...
Zer0Cam Posted August 26, 2007 Share Posted August 26, 2007 I am having the same problem aswell Link to comment https://forums.phpfreaks.com/topic/66304-drop-down-menu-not-displaying-correctly-in-ie/#findComment-334291 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.