Jump to content
php.lv forumi

Dropdown menu


KillerBean

Recommended Posts

  • 3 weeks later...

it kaa tieshaam Tev taisniiba... vieniigi tas menu gljuko bish ja vinjam pieliek 3. liimenja menu. :(

Varbuut kaads var paliidzeet?

Menu:

<ul id="nav"> 
<li><a href="#">Trīs</a> 
 <ul> 
 <li><a href="#">Nr.1</a></li> 
 <li><a href="#">Nr.2</a>
   <ul> 
   <li><a href="#">A</a></li> 
   <li><a href="#">B</a></li> 
   </ul> 
 </li> 
 </ul> 
</li>
</ul>

JS:

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;

 

Vinjsh kjipa atteelo arii uz sietienu arii 3. liimenja menu, lai gan tam normaali vajadzeetu atteeloties, tikai tad, kad uzbrauc uz 2. liimenja menu izveeles..

 

Un ja nodublee JS, un nomaina "nav" uz "nav2", menu skriptaa pieshkjir 2. liim. id - nav2, tad arii nekas neiet :(

Link to comment
Share on other sites

×
×
  • Create New...