You are here: Javascript problems « HTML « IT news, forums, messages
Javascript problems

Posted by Peter on 04/22/06 06:48

I'm trying to implement an n-level horizontal menu. I'm having a
problem. The ul tags are all id'd as "nav". If I go more than 1 level
deep I can't seem locate the ul tag using Javascript. I know that may
not be the best way to put it so I'll throw some code down. Where text
is "London" is where I can't get to in the DOM using Javascript.
Ideally, I'd like to make a recursive Javascript function to find and
appropriately handle each node, no matter how nested the lists become.
Any advice would be appreciated.

<ul id="nav">
<li><a href="#">Home</a></li>
<li><a href="#">About</a>
<ul id="nav">
<li><a href="#">History</a></li>
<li><a href="#">Team</a></li>
<li><a href="#">Offices</a></li>
</ul>
</li>
<li><a href="#">Services</a>
<ul id="nav">
<li><a href="#">Web Design</a></li>
<li><a href="#">Internet
Marketing</a></li>
<li><a href="#">Hosting</a></li>
<li><a href="#">Domain Names</a></li>
<li><a href="#">Broadband</a></li>
</ul>
</li>
<li><a href="#">Contact Us</a>
<ul id="nav">
<li><a href="#">United Kingdom</a>
<ul id="nav"><li><a href="#">London</a></li></ul>
</li>
<li><a href="#">France</a></li>
<li><a href="#">USA</a></li>
<li><a href="#">Australia</a></li>
</ul>
</li>
</ul>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация