To quickly loop through a list node and set a rollover CSS value, use the following
// Set all LI of a node to rollover CSS // Use two CSS class, e.g. item and itemover function updateList(String nodename) { if (document.all&&document.getElementById) { navRoot = document.getElementById(nodename); 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”, “”); } } } } } <body> <script>window.onload=updateList;</script> </body>
0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment