Author Topic: dropdown menus...  (Read 6803 times)

0 Members and 1 Guest are viewing this topic.

gopus

  • Newbie
  • *
  • Posts: 7
    • View Profile
dropdown menus...
« 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).

Databits

  • Global Moderator
  • *****
  • Posts: 1,607
  • Programming's not just a science, it's an art.
    • View Profile
dropdown menus...
« Reply #1 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 is a pretty hot little library with a pretty small footprint and powerful as hell.
(\_/)    ~Relakuyae D'Selemae
(o.O)    
(")_(")  [Libre Office] [Chrome]

gopus

  • Newbie
  • *
  • Posts: 7
    • View Profile
dropdown menus...
« Reply #2 on: March 09, 2007, 10:16:43 pm »
I solved the problem. Thanks anyway Databits, and I appreciate the jQuery link.