Hi folks, i m trying to make a simple nested menu. my problem is when i click on child li’s the parent as well as whole menu toggle to hide. i added a class too but its not helping.
You’re HTML has some misplaced tags, it should look like:
<body>
<ul class="topnav">
<li>Home</li>
<li>About
<ul class="xoxo">
<li>Folio</li>
<li>Fotography</li>
</ul> <!-- your end ul was in the wrong spot -->
</li>
<li>Contact me</li>
</ul>
</body>
If the intention in your javascript is to click an LI and show/hide the sub menu you would use something like the following:
Works for me in Firefox (latest), IE 7+, Opera 9+, Chrome (latest), Safari 4+
Like I implied, it would be helpful with a more detailed description of what you are trying to achieve. The grammar you used in your posts makes it difficult to understand.