The problem I am having is that I want to css style a second list on the same page but can't because my css for this is universal for all UL,LI elements. Or at least I think that is the problem.

So I can't seem to figure out how to add a class to these elements as well as integrate it into the javascript.

Your help is always so greatly appreciated!

linehand

11-11-2009, 09:16 PM

Well, for the JS I would try changing everywhere that it says nav and navRoot to nava and navaRoot for the first menu and navb for the second menu. Or you could try changing all of the getElementByIds to getElementByClasss
which might be the better option if it works like that.

I don't know the first thing about Javascript though. Worth a try anyway.

sackstein

11-11-2009, 10:29 PM

I dont need the second list style to work with the javascript. I just need it to be styled differently.

I don't know much if anything about javascript either which is the problem I think.

met

11-11-2009, 11:19 PM

if you want it to be styled differently simply do

ul#menu-two { /*style */ }
ul#menu-two li { /*style */}

<ul id="menu-two">
<li>gogo</li>
</ul>

linehand

11-12-2009, 05:23 AM

Yeah it looks like the javascript just finds ID="nav" and goes from there. So if you don't want to use the JS for the second list then you shouldn't need to do anything special at all. You can only have one thing with an ID="nav" on the page anyway. Just use new IDs and new classes for your second list and the JS shouldn't be an issue.

Personally I wouldn't recommend having your main navigation menu be dependent on javascript. I think it is a good idea to make sure your site at least won't appear broken if javascript is disabled by a visitor.