Lesson 9 - Spry Behaviors


DW Cover


Spry is officially called "Spry framework of Ajax" which is a collection of javascript programs that offer sophisticated control of a web site through widgets, effects, and data sets.

Spry Effects

The Spry Effects are selected in the Tag Inspector tab. They are used to enhance the visual experience and have no effect on functionality. They can be used to draw the attention of the user to a particular region of the web page. Before you use them you must give the tag that is to use the behavior an ID if it does not already have one. Click on the tag and click on the Attributes button and enter an ID next to the id attribute.

Spry Effects

After the tag has an ID then select the Behaviors button and then click on the + to access the Spry Effects.

Spry Effects Behavior


Spry Widgets

There are five Spry Widgets that may be used for web site navigation and organizing information. These widgets are the menubar, tabbed panels, accordian, collapsible panel, and tooltip which are located in the Insert Panel near the bottom.


Spry Menu

1. Spry Menu Bar

The Spry Menu Bar is used for navigation and allows you to put links into a compact horizontal or vertical menubar. These links might be to other pages within your site or to sites outside your web site.

To create a horizontal menubar select the menubar widget and select horizontal from the popup window.

Spry Menubar

A horizontal menu containing four items is placed across the top of the page.

SpryMenuBarHTML

To add labels and links go to the Property Inspector. The item is selected by clicking on it in the column with the "+-" and arrows. In this example Item 1 is selected and it has three submenus associated with it. In the Text box type in the label and in the Link box type in the link. To remove an item click on the "-" button. To shift positions click on the arrow buttons. In order for the menubar to show up in the Property Inspector the tab above the menubar in the design view must be clicked. To customize the menubar in CSS click on the "Customize this widget" link which will bring up the Dreamweaver Help that shows how to do this.

Spry Menubar Property Inspector


Try the Spry Menubar. Click on an menu item.

 


2. Spry Tabbed Panels

Spry Tabbed panels are great for organizing a lot of information on one page. There may be any number of them but only the selected one is shown. I created a page that has two tabs, Home, and Kevin Bacon. Below is a snapshot of the code and desgin views and the Property Inspector. The content of the Home tab is displayed in the design view.

Spry Panels

To view the contents of the Kevin Bacon tab move the cursor to the Kevin Bacon tab and click on the eye that appears.

Spry Panel Select Tab

Below is what a Spry tabbed panel looks like when rendered in the browser. The contents of the Home tab are displayed because the default panel is set to the Home tab. When you click on the Kevin Bacon tab the contents of Home will disappear and the contents of Kevin Bacon are shown.

Spry Panels in Browser


Try the Spry Tabbed Panel. Click on the Kevin Bacon and Home tabs.

Who are 'we' anyway?

There are only 6 degrees of separation...

Social Graphs

Kevin Bacon

The idea of Six Degrees of Kevin Bacon started innocently enough. Kevin Bacon, at a premiere for a movie, jokingly said, “I think I have worked with every actor in Hollywood.”

This idea took off in and quickly spawned the Six Degrees of Kevin Bacon game which eventually led to the 6 Degrees To Kevin Bacon Calculator, called the Oracle of Bacon.

Elvis Bacon Number

Enter the name of an actor and if that actor has appeared in a movie with Kevin Bacon their Bacon # will be 1. For instance, Elvis Presley can be connected to Kevin Bacon through just one person, Suzanne Covington. (From the Unique List Online)

 

Play the game

 

 

3. Spry Accordian

Spry Accordian is another way to save space yet provide a lot of content. I created content for two tabs, Silobreaker: Semantic Networks and TED Sphere: Semantic Networks. Notice that the eye is on the far right of the TED Sphere: Semantic Networks bar.

Spry Accordian

The image below is what a Spry accordian looks like in the browser. The contents of the TED Sphere tab is currently being displayed. When you click on Silobreaker: Semantic Networks, the contents in the TED Sphere tab will collapse and the Silobreaker contents will be revealed.

Spry Accordian in Browser


Try the Spry Accordian. Click on the 'Semantic Networks - TED Sphere' bar to reveal the panel. After you do this the 'Semantic Networks - Silobreaker' panel will be hidden.

Silobreaker: Semantic Networks
Silobreaker
This is a snapshot from the silobreaker web site of a graphical representation of news reportings having to do with fuel cells.
TED Sphere: Semantic Networks
TED Sphere
Videosphere
an audiovisual
knowledge network
Created by Bestiario (totally independant from TED.com), a conversation between art, science, technology, and society.

4. Spry Collapsible Panel

Spry Collapsible panels are shown as a bar in their collapsed state and when the arrow is clicked the panel containing the content opens just below the bar. It is useful for showing small pieces of information and for logging in.

Spry Collapsible Panel

When you click on the collapsible panel the contents of the panel are revealed. When you click on the panel again the content collapses. Below is a snapshot of the Collapsible panel in the browser after the panel has been clicked to reveal the contents.

Spry Collapsible in Browser

Try the Collapsible Panel. To see the panel click on the 'Wild World of Dendrites...' bar located on the next line.

Wild World of Dendrites...
Dendrites

Credit: Dr Jonathan Clarke, Wellcome Images

Neurons in the brain, Pyramidal neurons forming a network in the brain. These are nerve cells from the cerebral cortex that have one large apical dendrite and several basal dendrites.

Dendrite Diagram

 

Every nerve cell has input from as many as 1,000 dendrites or more connected to other nerve cells, to feed it information on which it acts (or fires) or doesn't act (inhibition).

 

Professor G. Cartwright
3700 McTavish
Montreal Qc
Canada H3A 1Y2

 


5. Spry Tooltips

The Spry Tooltip widget exposes additional information when a user hovers over a particular element on the page. The additional content disappears when the user stops hovering. You can also set tooltips to stay open for longer periods of time so that users can interact with content inside the tooltip. Below a delay on show and hide is set to 20 milliseconds.

Spry Tooltips


When you move the mouse over the image the tooltip is shown. Spry Tooltips allows you to add any html so you are able to create sophisticated markup. In this example there is text and an image.

Spry Tooltips in Browser


Try the Spry Tooltip. To see the tooltip roll the mouse over the image.

Elephants in Savanna

This is the banner for my blog.

The elephants are roaming the African savanna.

Map of African savannas

African Savannas

Examples


References and Resources


* click the link below to read this week's homework assignment *
Assignment 9