1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
//déclaration des fonctions onmouseover et onmouseout des lments LI
var sfEls = document.getElementById("nav").getElementsByTagName("li");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
survol=true;
this.className+=" highlight";
switchMenu(this);
}
sfEls[i].onmouseout=function() {
survol=false;
if (this.className=="highlight") { //bug FF: si pas de nom de classe, le " " initial n'est pas insr !!!
this.className=this.className.replace(new RegExp("highlight\\b"), "");
} else {
this.className=this.className.replace(new RegExp(" highlight\\b"), "");
}
if (nbDeclencheur<6) {nbDeclencheur++;setTimeout('fermetureRetardee()',dureeRetard)};
}
} |
Partager