I need some help with the following code found on 'A List Apart':
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;
The code is for a hybrid css dropdown menu. All is well when I use the code as provided. What I would like to add is a delay in hiding the sub-menu (node.onmouseout=...). I can't get a setTimeout to work. Any suggestions would be appreciated. Thank you.