View Single Post
  #5 (permalink)  
Old 02-13-2008, 04:26 AM
ryanhellyer's Avatar
ryanhellyer ryanhellyer is offline
Super Moderator
 
Join Date: Dec 2007
Posts: 708
Default

The code you have pointed out there is the CSS which controls how the div tag behaves when it is inside a link, both as normal and when hovered over with the mouse.

Display:none indicates that you can not see div at all and display:block indicates that it will be displayed as a block element. Hopefully that makes some sense!


In general, you should avoid creating dropdowns in Javascript and only use the Javascript to help out older browsers like IE6 which can not handle basic CSS.

I've created a WordPress plugin for creating dropdown menus which may be useful as a demonstration for you ... Plugin page | Demo page

If you have a look at the code on the demo page, you will see that the CSS file controls the behaviour of the dropdown and there is a small Javascript to kick the menu down in older versions of IE. There are quite a few things going on in the creation of such dropdowns so I suggest having a go at modifying/adapting the code for your own needs and if you have any troubles post back here.
Reply With Quote