PDA

View Full Version : Dropdown problem



Bram.
Feb 5th, 2010, 01:54 PM
my code:

the CSS:
#nav li ul{
position:absolute;
width:10em;
left:-999em;
}
#nav li:hover ul{
left:auto;
}
#nav li:hover ul, #nav li.sfhover ul{
left:auto;

a javascript function:
sfHover=function(){
var sfEls=document.getElementById("nav").getElementsByTagName("LI");
for (var i=0;i<sfEls.length;i++){
sfEls[i].onMouseOver=function(){
this.className+=" sfHover";
}
sfEls[i].onMouseOut=function(){
this.className=this.className.replace(new RegExp("sfHover\\b","");
}
}
}
if (window.attachEvent) window.attachEvent("onload",sfHover);

the body code:
<h2>
<!--kleur wit,mogelijk rand-->
<!--<a href="naverwerkingInvoer.html">Nieuws invoeren</a>-->

<ul id="nav">
<li><a href="naverwerkingInvoer.html">Invoer</a>
<ul>
<li><a href="tekst.html">Een stuk tekst</a></li>
<li><a href="link.html">Een verwijzing naar een andere site</a></li>
<li><a href="melding.html">Belangrijke gebeurtenis of melding</a></li>
</ul>
</li>
<li><a href="mailto:#@#.com?subject=Contact webpagina ">Contact</a></li>
</ul>
</h2>







I got this from suckerfish but I can't seem to find the problem...

abduraooft
Feb 5th, 2010, 02:28 PM
I got this from suckerfish but I can't seem to find the problem... What do you expect from us?

Bram.
Feb 5th, 2010, 03:44 PM
that anyone could find the error that i made.
the dropdown doesnt work and i dont know why, i was wondering if anyone knews

abduraooft
Feb 5th, 2010, 04:05 PM
That code gives me a simple vertical drop down effect in FF. http://htmldog.com/articles/suckerfish/dropdowns/ is a good tutorial on making drop down menu.