Dreamweaver DHTML Menu
To start the tutorial, download this zip file (PopEm.zip) which contains files needed for completing this tutorial.
Creating the Drop Downs
The file popem.htm is a basic HTML document with the following divs:
The div #menu consists of three buttons. In this tutorial we will create a drop down for Button 2. Switch to code view and position your cursor at the end of menu #div and start of #content div. Insert a layer as shown below.
Switch back to design view.Open the Layers Panel (F2) and change the name of the layer from "Layer1" to "SubMenu2" as shown below. With the layer selected, modify the Left(L), Top(T) and Width(W) as shown below. Make sure H is empty.
Inside the newly created Layer type out your submenu links as shown below. Make sure that there are no separating <br> tags between the submenu links.
Your code should look like this:
Open the css file stylesraw.css and add the following code:
We are using a defined class subs so that additional submenu layers can share the same class. Save and css file and close it.
Select the div #SubMenu2 in your Dreamweaver status bar and set its class to subs as shown above. Switchback to code view and position your cursor just before </body> and insert another layer. Change its name to closer and drag it below SubMenu2 in your layers panel and change its properties as shown below.
The closer layer will hide the submenu onMouseOver. Insert a transparent 1x1 px shim image and resize it as shown below.
Open the Behaviors Panel (Shift + F4). Click the + Button and Choose "Show_Hide Layers" Behavior.
Select each layer and click "Show" Button.
Make sure onMouseOver is selected as the event.
Select the transparent image within the closer layer and create a null link.
Apply the Show-Hide Behavior to this layer this time selecting hide as shown below.
Make sure onMouseOver event is selected.
Similarly Convert Buttons 1 and 2 into null links and Apply Show-Hide Layer to Button 1 and Button 2, selecting to hide the layers onMouseOver.
Hide the two layers by clicking below the eye icon, till you see a closed eye as shown below. This changes the visibility of the layers to hidden.
Your Drop Down Menu is now ready and you can test it on your browser (F12).