No replies
Dr. Valentine
Offline
newbie
Last seen: 8 years 12 weeks ago
Joined: 2006-05-08
Posts: 1
Points: 0

Now what is wrong with this code? It's meant to make a "drop-down-list" effect by making the div titled "nav1" appear and disappear.

Works fine in MSIE, but Firefox tells me in its Javascript console that "nav1" isn't defined.

Does this fail because "nav1" is defined later in the script? Any ideas or suggestions?

<div class='x200x14' onMouseover="nav1.style.display='block'"; onMouseout="nav1.style.display='none'";>Love and Hotsauce:
<div class='x200' id='nav1' style='display:none;'>
<a href='index.php'>The Wall</a>
<a href='index.php?Mode=99'>Write on The Wall</a></div>/div>

The code can ve viewed on the actual page at http://www.loveandhotsauce.net/index.php

Mouse over the floating "love and hotsauce" bar under the heart.

***Edit: Solved!
Turns out that although that works in MSIE, the correct way to do it is document.getElementById('nav1').style.display='none';

So uh. Thanks anyway!

Tags: