Building a Horizontal Menu in Dreamweaver CS3 Using Spry R. Berdan In earlier versions of dreamweaver web developers attach drop down menus to graphics or hyperlinks by using the behavior box. Dreamweaver CS3 still permits users to edit and modify these drop down menus, but they have removed the ability to create new drop down menus using the behavours box (so keep an old version of Dreamweaver around if you have one) The reason being that with the older method, the script was embedded in each page and if the user wanted to update a web site they usually had to update every page. I say usually, because if you copied the script into the external mm_menu.js file created when making a pop down menu you only needed to change one page and have all pages updated but many web developers apparently did not know this. In this tutorial I will show you how to add a drop down menu and modify its appearance. Build your own drop down menu using CS3 Spry. 1. First you should build a template page with a spot that you can insert the horizontal spry menu. Start Dreamweaver, insert table 4 rows, 1 column, width 772 pixels, border=0 then center the table. 2. Add some nobreaking space in the head and content area and fill the background color of the top and bottom rows with navy blue or whatever color you like. Save the page into a new folder and call the web page template.html. 1
3. Place your cursor in the 2 nd row where the navigation bar will go and click on the 4 th icon from the right in the Spry menu. (Circled in red below) 4. Select horizontal menu from the pop up. 5. The menu appears with Item 1, Item2, Item 3 as 4 generic gray buttons see below. To modify the text select Item 1 in the properties box and on the right side type in the Text e.g. Welcome, and change the # in the Link text box to the web page you want the menu to link to. You can click on the + - icons to add or subtract menus and submenus. 6. Add two more main menu items if your menu wraps to the next line, you may need to adjust the table width to accommodate all the buttons or you can adjust the width of the buttons. If we 2
want to include one more button so we can put 7 across the top click on the bottom of the first button so there is a blue bounding box around it. In the properties box below - locate the W box with value 8em inside this is the width of your buttons. The default is 8em you can make the button smaller by typing in 7em or type in a pixel value like 110 px. Then add one more button by selecting the light blue tap on top of the button and in the properties box click on + symbol in the first left box with Item 1 etc. You should have 7 buttons across the top. After adding two more buttons 7. Assign text values to each of the buttons by typing over the existing text as follows from left to right: Welcome, About Us, Services, Gallery, Links, News, Contact Us Then modify the font size, color, style on each button, click and drag to select the text and use the property box to modify the font e.g Set font size 2, bold, arial, color dark blue #000066. File Preview the first time you do this Dreamweaver will prompt you to save the Spry scripts accept and preview your page. The scripts are stored in an external folder called SpryAssets and must be uploaded with the web page to your server when you are done. 3
In preview mode your menu should like the one above. Note the down facing triangle is only those menus with drop down components like the first one. Format the font, size, color using the properties box for the submenu items. 8. Add or delete submenus as required and add links for all your pages and then save. Under Welcome add submenu items and links for : Prices, Request quote, Hiring and under the News menu add: Recent, Old news, Archive. Modify the menu alignment simply use the property box, select the text, then select left, center or right alignment. Left alignment is the default. At this point you should have a functional menu which you add or delete submenu items. To customize the buttons further including the background color of the buttons, the rollover colors you will need to view your CSS side panel. Select CSS ALL and expand the window to see all of the CSS elements. 4
SpryMenuBarHorizontal.css - Each of the values for the CSS pseudo classes is below 1) ul.menubarhorizontal The outermost container of the Menu Bar, an auto width box with no margin or padding 2) ul.menubaractive Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug 3) ul.menubarhorizontal li Menu item containers, position children relative to this container and are a fixed width 4) ul.menubarhorizontal ul Submenus should appear below their parent 5) ul.menubarhorizontal ul.menubarsubmenuvisible Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item 6) ul.menubarhorizontal ul li left: auto; Menu item containers are same fixed width as parent 7) ul.menubarhorizontal ul ul Submenus should appear slightly overlapping to the right (95%) and up (-5%) 8) ul.menubarhorizontal ul.menubarsubmenuvisible ul.menubarsubmenuvisible Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen DESIGN INFORMATION: describes color scheme, borders, fonts these are the ones you can or should modify leave the ones above alone. 9) ul.menubarhorizontal ul Submenu containers have borders on all sides The default border is 1 px solid #CCC i.e. gray here I change the broder to 4 px around the submenus. 10) ul.menubarhorizontal a Menu items are a light gray block with padding and no text decoration Properties box: color is the font color of the text in the submenus background color is the color of the background for the main menu 5
11) ul.menubarhorizontal a:hover, ul.menubarhorizontal a:focus Menu items that have mouse over or focus have a blue background and white text Background color controls the main rollover color and submenus 12) ul.menubarhorizontal a.menubaritemhover, ul.menubarhorizontal a.menubaritemsubmenuhover, ul.menubarhorizontal a.menubarsubmenuvisible Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text - here I changed the background-color to purple. CSS items in the list 9-12 are the main ones that control the color and appearance of the menu items modify these to set the colors you want in your menu using the properties box below the CSS Rules. 6
Add a photo to the top, change your background color of your page and you are ready to go. One problem I had was the menu did not align on the right exactly with the table so I change the background color in the nav <td bgcolor= #EEEEEE > to match the menu nothing is perfect! Note: There are many third party Dreamweaver extensions web developers can download that assist them in making better looking menus for under a $100. Links to some of these 3d party products are as follows: 1. http://www.xtreeme.com/dhtml/ Extreme DHTML menus $49-$100 2 http://f-source.com/products/#vista%20drop%20down%20menu - F-source menu 18 menus $99 very slick mac, vista and many other styles. 7