| Код | <script language="JavaScript"> var isIE, isNS, isNS6, isDOM, lR, sR, vis, invis, myTimeOut, goName; if (document.all) {isIE= true;lR="document.all.";sR=".style";vis="visible";invis="hidden";} if (document.layers){isNS = true;lR="document.layers.";sR="";vis="show";invis="hide";} if (document.getElementById &&!isIE) {isDOM=true;lR = "document.getElementById('";sR = "').style";invis ="hidden";vis = "visible"} if (isDOM == true && navigator.appName =="Netscape") isNS6 = true; var oldwhich = 0; var x=0; var layerTimer; //показать подменю function layOver(which) {x=0;l = eval(lR + "l" + which + sR); if (oldwhich != which){ ol = eval(lR + "l" + oldwhich + sR);ol.visibility = invis;} l.visibility = vis; oldwhich = which; clearTimeout(layerTimer); return;} // спрятать подменю function stopOver() { if (x<5) x++; else { ol = eval(lR + "l" + oldwhich + sR); ol.visibility = invis; x=0; } layerTimer = setTimeout("stopOver()",10) }
//обнулить тамер function startOver() { x=0 clearTimeout(layerTimer); } </SCRIPT>
|
как переделать этот сскрипт, чтобы в <td onmouseout=stopOver() onmouseover=layOver(1)> не указывать в скобках номер пункта , а в <div id=l1> не указывать id ? То есть чтобы скрипт был универсальным и открывал и прятал слои не зависимо от его id |