View Full Version : Simple two second question
Bradyn
06-03-2005, 12:44 AM
I'm working on redoing the html of a website, and I need help. In an effort to make it more complient I've stolen (not for the first time, trust me) a nifty little horizontal menu from A List Apart (http://www.alistapart.com). I've made changes to it to suit my peticular style of using css, but I've hit a snag with the javascript.
http://www.capturetheflag.com/new/
http://www.alistapart.com/articles/horizdropdowns/
You can see what I've done.
Instead of:
<ul id="nav">
I've done:
<div id="navigation">
<ul>
Any help would be awesome!
_Aerospace_Eng_
06-03-2005, 12:55 AM
What is your purpose for starting it that way? Why don't you wan't to put in id="nav" in the main ul?
Bradyn
06-03-2005, 12:58 AM
Like I said, it's the way I code.
_Aerospace_Eng_
06-03-2005, 01:09 AM
Okay so just because its the way you code, and you don't want to put two words inside of a simple ul tag, you want us to change the javascript? Just add id="nav" to the ul its not going to make your page look any different. The real problem is in your css
#navigation li:hover ul, li.over ul {
display: block;
}
should be
#navigation li:hover ul, #navigation li.over ul {
display: block;
}
Bradyn
06-03-2005, 01:22 AM
Okay, corrected. n00b mistake.
However, I'm asking if anyone can show me how to modify the javescript.
RysChwith
06-03-2005, 08:33 AM
You would want to change this line:navRoot = document.getElementById("nav");to this:navRoot = document.getElementById("nav").firstChild;That's assuming the UL is always going to be the first thing in the nav div. If that might change, you'll have to get a bit more complicated by searching through all of nav's children until you find a UL with class nav.
Rys
Bradyn
06-04-2005, 07:20 PM
Alright, thanks a lot guys.
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.