04.02.2013 Views

Spry User Guide - Support - Adobe

Spry User Guide - Support - Adobe

Spry User Guide - Support - Adobe

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3 Locate the MenuBarHorizontal class in the HTML code for the horizontal menu bar, and change it to MenuBarVertical.<br />

The MenuBarHorizontal class is defined in the container ul tag for the menu bar ().<br />

4 After the code for the menu bar, locate the menu bar constructor:<br />

var menubar1 = new <strong>Spry</strong>.Widget.MenuBar("menubar1",<br />

{imgDown:"<strong>Spry</strong>Assets/<strong>Spry</strong>MenuBarDownHover.gif",<br />

imgRight:"<strong>Spry</strong>Assets/<strong>Spry</strong>MenuBarRightHover.gif"});<br />

5 Remove the imgDown preload option (and comma) from the constructor:<br />

var menubar1 = new <strong>Spry</strong>.Widget.MenuBar("menubar1",<br />

{imgRight:"<strong>Spry</strong>Assets/<strong>Spry</strong>MenuBarRightHover.gif"});<br />

Note: If you are converting from a vertical menu bar to a horizontal menu bar, add the imgDown preload option and<br />

comma instead.<br />

6 (Optional) If your page no longer contains any other horizontal Menu Bar widgets, delete the link to the former<br />

MenuBarHorizontal.css file in the head of the document.<br />

7 Save the page.<br />

Customize the Menu Bar widget<br />

The <strong>Spry</strong>MenuBarHorizontal.css and <strong>Spry</strong>MenuBarVertical.css files provide the default styling for the Menu Bar<br />

widget. You can, however, customize the widget by changing the appropriate CSS rule. The CSS rules in the<br />

<strong>Spry</strong>MenuBarHorizontal.css and <strong>Spry</strong>MenuBarVertical.css files use the same class names as the related elements in<br />

the menu bar’s HTML code, so it’s easy for you to know which CSS rules correspond to the different sections of the<br />

Menu Bar widget. Additionally, the <strong>Spry</strong>MenuBarHorizontal.css and <strong>Spry</strong>MenuBarVertical.css files contain class<br />

names for behaviors that are related to the widget (for example, hovering and clicking behaviors).<br />

The horizontal or vertical styling sheet for the widget should already be a included in your website before you start<br />

customizing. For more information, see “Prepare your files” on page 3.<br />

Style a Menu Bar widget (general instructions)<br />

You can style an Menu Bar widget by setting properties for the entire Menu Bar widget container, or by setting<br />

properties for the components of the widget individually.<br />

1 Open the <strong>Spry</strong>MenuBarHorizontal.css or <strong>Spry</strong>MenuBarVertical.css file.<br />

2 Locate the CSS rule for the part of the menu bar to change. For example, to change the background color of the toplevel<br />

menu items, edit the ulMenuBarHorizontal a or ulMenuBarVertical a rule in the <strong>Spry</strong>Accordion.css file.<br />

3 Make your changes to the CSS and save the file.<br />

You can replace style-related class names in the CSS files and HTML code with class names of your own. Doing so<br />

does not affect the functionality of the widget.<br />

The <strong>Spry</strong>MenuBarHorizontal.css and <strong>Spry</strong>MenuBarVertical.css files have extensive comments, explaining the code<br />

and the purpose for certain rules. For further information, see the comments in the file.<br />

SPRY<br />

<strong>User</strong> <strong>Guide</strong><br />

42

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!