Forum Moderators: open
Thanks!
Can you show a simplified example of the code? That's the only way I'd feel comfortable say "absolutely yes".
Can you show a simplified example of the code? That's the only way I'd feel comfortable say "absolutely yes".
That would be great. Here is a snippet of the HTML:
<div onClick="JavaScript: outlineAction();">
<ul>
<li class="Main">Animals & Pets
<ul>
<li class="Item"><a href="Category29.htm">Cats</a></li>
<li class="Item"><a href="Category30.htm">Dogs</a></li>
<li class="Item"><a href="Category31.htm">Horses / Livestock</a></li>
<li class="Item"><a href="Category102.htm">Other Pets</a></li>
<li class="Item"><a href="Category101.htm">Reptiles</a></li>
</ul>
</li>
<li class="Main">Arts & Crafts
<ul>
<li class="Item"><a href="Category22.htm">Body Art</a></li>
<li class="Item"><a href="Category23.htm">Crafts</a></li>
<li class="Item"><a href="Category24.htm">Galleries</a></li>
<li class="Item"><a href="Category25.htm">Literature</a></li>
<li class="Item"><a href="Category26.htm">Organizations</a></li>
<li class="Item"><a href="Category27.htm">Photography</a></li>
<li class="Item"><a href="Category28.htm">Poetry</a></li>
</ul>
</li>
</ul>
</div>
The 'class="Main"' attributes on list items that contain lists are probably useful, but the 'class="item"' attribute on every list item is just not needed. Try something like this instead:
-B
ul element like this: <div onClick="JavaScript: outlineAction();">
<ul>
<li class="Main">Animals & Pets
<ul [b]class="Item"[/b]>
<li><a href="Category29.htm">Cats</a></li>
<li><a href="Category30.htm">Dogs</a></li>
<li><a href="Category31.htm">Horses / Livestock</a></li>
<li><a href="Category102.htm">Other Pets</a></li>
<li><a href="Category101.htm">Reptiles</a></li>
</ul>
</li>
<li class="Main">Arts & Crafts
<ul [b]class="Item"[/b]>
<li><a href="Category22.htm">Body Art</a></li>
<li><a href="Category23.htm">Crafts</a></li>
<li><a href="Category24.htm">Galleries</a></li>
<li><a href="Category25.htm">Literature</a></li>
<li><a href="Category26.htm">Organizations</a></li>
<li><a href="Category27.htm">Photography</a></li>
<li><a href="Category28.htm">Poetry</a></li>
</ul>
</li>
</ul>
</div> In your CSS you can style the list elements like this:
.Item li {
// your styles here
} On a big list, that will save you a lot of markup weight. :)
javascript to make the menus collapse and expand.
This means that a single .class won't work - but you can still follow the basic advice here and give each ul its own #ID -- then get the javascript to switch the display characteristics of an entire ul by changing the display: rule for ID, rather than addressing each item.
If a url is readable as text within javascript, then spiders MAY try to spider it and perhaps include the page in the index. But in such a case link pop, pagerank etc will not be passed.
eg: <li><a href="link.htm" onclick="activate_menu">link 1</a></li>
If, on the other hand, the javascript is actually writing out the menu, like way too many menuing systems do, there is a huge problem using javascript.