Custom drop down

Posted by Rob on Stack Overflow See other posts from Stack Overflow or by Rob
Published on 2010-03-22T13:28:04Z Indexed on 2010/03/22 13:31 UTC
Read the original article Hit count: 344

Filed under:
|

I'm trying to create a custom drop down and using the code below it works pretty well - only one problem is if i have more than one drop down, all the links will only activate the first drop down. Any ideas on how I would fix that? (and yes I know about Suckerfish I just need to get this to work)

function toggle() {
 var ele = document.getElementById("dropdown-items");
 var text = document.getElementById("dropdown-menu");
 if(ele.style.display == "block") {
      ele.style.display = "none";
   }
 else {
  ele.style.display = "block";
 }
}

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about dropdown