extending a website with spry
Skip this Video
Download Presentation
Extending a Website with Spry

Loading in 2 Seconds...

play fullscreen
1 / 20

Extending a Website with Spry - PowerPoint PPT Presentation

  • Uploaded on

Extending a Website with Spry. Dawn Pedersen. What is Spry?. Spry is Dreamweaver’s version of JavaScript libraries. Spry effects alter the look of a page element—or of the whole page itself—when a particular event occurs. Spry effects are event-driven, so you need to decide:

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Extending a Website with Spry' - annora

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
what is spry
What is Spry?
  • Spry is Dreamweaver’s version of JavaScript libraries.
  • Spry effects alter the look of a page element—or of the whole page itself—when a particular event occurs.
  • Spry effects are event-driven, so you need to decide:
    • which event to use
    • which HTML element to trigger it
    • which element to apply the effect to.
  • For example, you could attach a Spry effect to the element of a page and use the onLoad JavaScript event to trigger it when the page loads.
working with spry
Working with Spry
  • All Spry effects are grouped in the Behaviors tab within the Tag Inspector panel in Dreamweaver.
  • Rather than getting into Spry in depth, we will use the more automated Spry UI components, which be found here:
    • Open the Insert panel
    • Choose Spry from the dropdown menu
    • Select a Spry component to insert on your page
spry ui components
Spry UI Components
  • There are five basic Spry user interface components (or widgets) designed to be used out-of-the-box:
    • Menu bars
    • Tabbed panels
    • Accordion panels
    • Collapsible panels
    • Tooltips
working with spry1
Working with Spry
  • Follow these guidelines whenever working with Spry components:
    • Always create a site definition for your site and save the current page within it.
    • After inserting a Spry component, save all the associated files within your site, including external JavaScript and CSS files.
    • To see the component’s details in the Property Inspector, hover your mouse over the widget in design view. When the tab appears at the top-left of the component (attached to a surrounding border,) click on it.
exercise spry menu bar
Exercise: Spry Menu Bar
  • Create an empty folder called “Spry” on your Desktop.
  • Create a blank HTML page in Dreamweaver (File > New, Blank Page - HTML - ).
exercise spry menu bar1
Exercise: Spry Menu Bar
  • Save the file as “menu.html” inside your Spry folder.
  • View the page in Design view.
  • Open the Insert panel, set it to Spry, and click on Spry Menu Bar.
  • Select Horizontal from the dialog box and click OK.
exercise spry menu bar2
Exercise: Spry Menu Bar
  • Dreamweaver inserts a horizontal Spry Menu Bar at the top of the page.
  • Like all Spry widgets, the menu bar is surrounded in Design view by a turquoise border with a tab at the top-left corner.
  • The tab tells you what type of widget it is, followed by the widget’s ID attribute.
  • Dreamweaver calls the first menu bar on a page “MenuBar1”. The next one is “MenuBar2” and so on.
exercise spry menu bar3
Exercise: Spry Menu Bar
  • Notice that the Related Files toolbar lists two files: SpryMenuBar.js and SpryMenuBarHorizontal.css.
  • Until you save the page, these are temporary files. It’s essential that you save the file before doing anything else.
exercise spry menu bar4
Exercise: Spry Menu Bar
  • Save menu.html. You are prompted to save the dependent files (including CSS and some image files.)
  • Click OK. The dependent Spry files are saved to a new folder in your site named SpryAssets.
exercise spry menu bar5
Exercise: Spry Menu Bar
  • Click the Live View button in the Document toolbar.
  • Hover your mouse pointer over the menu bar. The menu bar is ready to customize.
  • Turn off Live View.
exercise spry menu bar6
Exercise: Spry Menu Bar
  • The Spry menu bar is a series of nested unordered lists styled with CSS to look like buttons.
  • The submenu flyouts are controlled by JavaScript.
  • Select the menu bar in Design view (click on its turquoise tab.)
  • Click on the Turn Styles Off button in the Property Inspector.
  • Review the menu structure without the CSS styles applied.
  • Click on the Turn Styles On button in the Property Inspector.
exercise spry menu bar7
Exercise: Spry Menu Bar
  • You can, if you wish, turn off the styles and edit the menu directly in Design view.
  • However, it’s more convenient to do it in the Property Inspector.
  • Select the menu bar in Design view (click on its turquoise tab.) The three columns in the Property Inspector show the menu hierarchy, with the top level on the left.
exercise spry menu bar8
Exercise: Spry Menu Bar
  • Select an item in this left column. The middle column displays the contents of the related submenu.
  • Select an item from the middle column. The right column displays the next level down from whatever is selected in the middle one.
exercise spry menu bar9
Exercise: Spry Menu Bar
  • To edit a menu item:
    • Highlight it in the Property Inspector.
    • Fill in the fields on the right edge of the Property Inspector as follows:
      • Text: The label you want to appear on the menu button
      • Link: The page you want to link to.
      • Title: Improves accessibility and displays a Tooltip on hover.
      • Target: Allows you to open in a new window or tab. This is rarely justified for a site’s navigation menu.
exercise spry menu bar10
Exercise: Spry Menu Bar
  • To add an item, click the plus (+) button at the top of the relevant column.
  • To delete an item, select it and click the minus (-) button.
  • To change the order of items, select an item and use the up or down button at the top of the relevant column.
  • Before moving to edit another part of the page, select one of the items in the left column first.
exercise spry menu bar11
Exercise: Spry Menu Bar
  • Edit the menu bar you created so that each button has a label, a link, and a title:
    • Use your IA diagram as a model, or use some sort of categorizing system.
    • You may add, delete, or reorder items as necessary, but have at least one button at the third level.
    • For the Link field, you can simply leave the pound (#) sign as a placeholder for some future page link.
  • Save all your files (File > Save All) and test the menu in a browser (F12).
example spry menu bar
Example: Spry Menu Bar

I created a hypothetical zoo site menu.

example spry menu bar1
Example: Spry Menu Bar

I tested my zoo menu in a browser.

customizing the css
Customizing the CSS

In SpryMenuBarHorizontal.css, style rules are divided into the following sections:

  • Layout Information—for the structure, such as font sizes and menu widths
  • Design Information—for the color scheme and borders.
  • Submenu Indication—for the display of the arrow images. Best left alone.
  • Browser Hacks—for dealing with Internet Explorer bugs. Leave these alone.

Plenty of comments in the CSS help guide you to edit the correct style rule.