Xepher.Net Forums

Content => Web Design => Topic started by: gopus on March 08, 2007, 09:34:43 PM

Title: dropdown menus...
Post by: gopus on March 08, 2007, 09:34:43 PM
Hey, I'm trying to remake my site ( http://gopus.xepher.net ), and I want to implement dropdown menus via javascript. I want to have the dropdown links show up UNDER the menu, so I want to alter the placement of the dropdown div respective to the menu div via javascript. I am not entirely sure how to do this, but I tried to do something like the following:

   document.getElementById('comicpulldown').style.top = document.getElementById('comicslink').style.top;
   document.getElementById('comicpulldown').style.left = document.getElementById('comicslink').style.left;

Where 'comicpulldown' is the div with the list of comics, and 'comicslink' is the actual menu the mouse hovers over to get the list. The values of comicslink do not impute onto comicpulldown so I am not entirely sure what to do. Not sure what the issue is, and it seems as if javascript/dhtml/etc. tutorials are progressively diminishing on the internet (good ones anyway).
Title: dropdown menus...
Post by: Databits on March 09, 2007, 06:22:56 PM
I suggest using an existing library out there for this. There's no need to reinvent the wheel for things like drop down menus, which are a pain in the butt to make work in backwards compatible environments as well.

On a side note, I've found that for many things javascript related, jQuery (http://jquery.com/) is a pretty hot little library with a pretty small footprint and powerful as hell.
Title: dropdown menus...
Post by: gopus on March 09, 2007, 10:16:43 PM
I solved the problem. Thanks anyway Databits, and I appreciate the jQuery link.