Hi there,
I have a piece of javascript that helps the functioning of css dropdown in i.e. The script uses getElementByID. The element being <ul id="nav">
I have placed this list in a left div and adjusted the css formatting of the list to affect only the ul in the left div. The javascript does not function. How do I have the script below call call/make reference to the <ul id="nav"> within the left div.
<script language="javascript" type="text/javascript">
<!--
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes;
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}
window.onload=startList;
//-->
</script>
Help appreciated.
Bob
I have a piece of javascript that helps the functioning of css dropdown in i.e. The script uses getElementByID. The element being <ul id="nav">
I have placed this list in a left div and adjusted the css formatting of the list to affect only the ul in the left div. The javascript does not function. How do I have the script below call call/make reference to the <ul id="nav"> within the left div.
<script language="javascript" type="text/javascript">
<!--
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes;
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}
window.onload=startList;
//-->
</script>
Help appreciated.
Bob