...

View Full Version : Code wont work in IE for drop down menu :(



SKY-ProToSs
10-06-2007, 06:13 PM
Here is the css:



ul {
padding: 0;
margin:auto;
list-style: none;
}
li {
Margin:auto;
position: relative;
width: 10em;
}
li ul {
background:#8e8e8e;
display: none;
position: absolute;
top: 1em;
left: 0;
}
li > ul {
top: auto;
left: auto;
}
li:hover ul {
display: block;
}


Here is the html:



<ul id="nav">
<li>Grunts
<ul>
<li id="menu"><a href="">Small</a></li>
<li id="menu"><a href="">Burrito</a></li>
<li id="menu"><a href="">Pigfish</a></li>
</ul>
</li>
</ul>


JAVASCRIPT:



startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}
window.onload=startList;


I really have no clue as to why this isn't working, if you could please give me a straight answer I would be pleased.

The site is on freewebs currently becuase I find it easy to make the design there ^_^

http://www.freewebs.com/clan-aad/

SKY-ProToSs
10-06-2007, 07:07 PM
I seem to have fixed my problem by trying a different method ty anyway though.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum