Hi
I am having trouble undertanding this code by javascript as it seems to read in the list elements given by the id tag into an array.
Then it displays them with classname?
The whole code works as a drop down menu and here is the javascript bit.
sfHover = function() {
var sfEls = document.getElementById(“nav”).getElementsByTagName(“LI”);
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=” sfhover”; //dont get this bit
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(” sfhover
}
}
}
if (window.attachEvent) window.attachEvent(“onload”, sfHover);
It seems to have an automatic event handler onload, display the 2nd level lists offscreen and back on screen when hover over 1st level using left:auto.
q) I can’t undertsand the mouse over function as how does it know to display the 2nd level lists?