Adobe
Products
Creative Suite
Photoshop Family
Acrobat Family
Flash Platform
Digital Marketing Suite
Digital Publishing Suite
More products
Solutions
Digital marketing solutions
Digital media solutions
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Store
Adobe Store for home and home office
Education Store for students, educators, and staff
Business Store for small and medium businesses
Other ways to buy
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections   Search  
Solutions Company
Help Learning
Sign in Welcome, My orders My Adobe
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Dreamweaver Developer Center /

Applying design to Spry widgets

by Chris Converse

Chris Converse
  • Codify Design Studio

Created

4 October 2009

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
CSS design Dreamweaver CS4 JavaScript Spry Spry widget

Requirements

Prerequisite knowledge

Familiarity with HTML, CSS, and either Adobe Photoshop or Adobe Fireworks.

User level

All

Required products

  • Dreamweaver CS4 (Download trial)

Sample files

  • spry_theme_01.zip (2038 KB)
  • spry_theme_02.zip (423 KB)
  • spry_theme_03.zip (474 KB)
  • spry_theme_04.zip (636 KB)
  • spry_theme_05.zip (2521 KB)
  • spry_theme_06.zip (720 KB)
  • spry_theme_07.zip (2197 KB)

The beauty of Spry and Adobe Dreamweaver is that adding Spry widgets to your page takes only a few seconds. Once you add a widget, Dreamweaver adds the necessary JavaScript and CSS files to make the magic happen. Given access to these files, especially the CSS, you can then customize the design using nothing more than CSS and some graphics.

We at Codify Design Studio have put together some themes—based entirely on the Spry markup and CSS rules—that you can use as is, or modify in your web projects. We also provide the sliced Adobe Photoshop files, so you can update the designs in a snap.

Introducing Spry

Spry is an Ajax (Asynchronous XML and JavaScript) framework developed by Adobe. There are many other free, open source Ajax frameworks to choose from. However, one of the unique aspects of Spry is that it is specifically designed to use standard HTML markup to create richer, more responsive "Web 2.0" web pages. Spry is designed to work with standard HTML tags (elements) and change the display and user experience of the markup with the help of JavaScript and CSS. What makes this approach so powerful is that it is very easy to add, edit, and design Spry widgets—all you need to be familiar with is HTML and CSS.

Adding to the ease of use of Spry is the visual authoring option for Spry widgets (introduced in Dreamweaver CS3) which includes adding, modifying, and integrating the visual CSS panel to help you customize the visual appeal and behaviors of your widgets.

The Advantages of Spry

The Dreamweaver Insert panel features five widgets grouped together in the layout section of the Spry panel (from left to right): Menu Bar, Tabbed Panels, Accordion, Collapsible Panel, Spry Tooltip (see Figure 1).

The layout section of the Spry panel
Figure 1. The layout section of the Spry panel

Simply clicking a widget with an XHTML file open will prompt Dreamweaver to create a series of HTML tags within your web page that relates to that particular widget structure. When you save your document. Dreamweaver will create a directory named SpryAssets, and then copy the corresponding JavaScript (.js) and cascading style sheet (.css) documents within the newly created SpryAssets directory. When you preview your web page using the new Live View feature in Dreamweaver CS4, or within a web browser, the HTML markup will be evaluated by the JavaScript file and—in coordination with the CSS file—the user display and experience of the markup will be altered to behave like that of the Spry widget you have selected.

What is most powerful about the Spry widgets is what happens if they don't work. If for some reason a visitor to your website does not have JavaScript enabled, or there is a network hiccough, the Spry widget will render as the standard HTML markup it is built from. This concept is called graceful degradation. An even greater benefit from the approach is the fact that the HTML markup is read by search engines in the same fashion as the other HTML on your website, so the structure of your content is not compromised by using Spry to enhance the user experience of your site. Figure 2 illustrates the graceful degradation of a page with JavaScript and CSS disabled.

The structure of your content is not compromised by using Spry.
Figure 2. The structure of your content is not compromised by using Spry.

The anatomy of a Spry widget

As I mentioned earlier, the Dreamweaver user interface supports the five widgets on the Layout tab of the Insert panel, and seven more widgets and advanced examples are included in the Spry download assets located in the samples directory of the Spry framework download. Figure 3 provides an at-a-glance view of the five widgets on the Layout tab.

Five Spry widgets at a glance.
Figure 3. Five Spry widgets at a glance.

Accordion widget

The Accordion widget (see Figure 4) contains an outermost container with a default ID name Accordion1. Inside the main container is a series of DIVs classed with AccordionPanel. Inside each panel DIV are two additional DIV classes, AccordionPanelTab and AccordionPanelContent. The content inside the AccordionPanelTab is the clickable item, and the content inside the AccordionPanelContent is opened when you click its corresponding tab. Click the buttons at the bottom of Figure 3 to isolate the various relationships between the HTML markup and the fully enabled widget.

The Accordion widget
Figure 4. The Accordion widget (click the buttons to isolate the various relationships between the HTML markup and the fully enabled widget)

Collapsible Panels widget

The Collapsible Panels widget (see Figure 5) contains an outermost container with a default ID named CollapsiblePanel1. Inside the main container are two DIVs: one classed with CollapsiblePanelTab and the other with CollapsiblePanelContent. The CollapsiblePanelTab is the clickable item, and the content of the CollapsiblePanelContent is opened when you click the tab. Click the buttons at the bottom of Figure 5 to isolate the various relationships between the HTML markup and the fully enabled widget.

Figure 5. The Collapsible Panels widget (click the buttons to isolate the various relationships between the HTML markup and the fully enabled widget)

Menu Bar widget

The Menu Bar widget (see Figure 6) is based entirely on unordered lists. The outermost list has a default ID named MenuBar1. Each list item (li) has an anchor (a) element classed with MenuBarSubMenu. The first series of list items under the main unordered list (ul) acts as the row of visible menu items in your widget. Nested unordered lists act as the drop-down menus (triggered on mouseover) to the list item they are nested in. Though the Properties panel in Dreamweaver only supports three levels of nested items, the JavaScript and CSS support any number of nested menu items. Click the buttons at the bottom of Figure 6 to isolate the various relationships between the HTML markup and the fully enabled widget.

The Menu Bar widget (click the buttons to isolate the various relationships between the HTML markup and the fully enabled widget)
Figure 6. The Menu Bar widget (click the buttons to isolate the various relationships between the HTML markup and the fully enabled widget)

Tabbed Panels widget

The Tabbed Panels widget (see Figure 7) contains an outermost container with a default ID named TabbelPanels1. Inside the main container is an unordered list classed with TabbedPanelsTabGroup and a DIV classed with TabbedPanelsContentGroup. Each list item (li) inside the tab group is classed with TabbedPanelsTab. Each content DIV in the content group is classed with TabbedPanelsContent. Each TabbedPanelsTab in the tab group is a clickable item that displays its corresponding TabbedPanelsContent DIV in the TabbedPanelsContentGroup DIV. Click the buttons at the bottom of Figure 7 to isolate the various relationships between the HTML markup and the fully enabled widget.

The Tabbed Panels widget (click the buttons to isolate the various relationships between the HTML markup and the fully enabled widget)
Figure 7. The Tabbed Panels widget (click the buttons to isolate the various relationships between the HTML markup and the fully enabled widget)

Tool Tip widget

The Tool Tip widget (see Figure 8) contains text, or an image, wrapped in a container with an ID named sprytrigger1. Also on the page is a content DIV with an ID of sprytooltip1. By default, the tool tip trigger is contained within a span tag and the content of the tip is contained with a DIV. In actuality, the trigger and content can be in any kind of HTML tag. Click the buttons at the bottom of Figure 8 to isolate the various relationships between the HTML markup and the fully enabled widget.

Figure 8. The Tool Tip widget
Figure 8. The Tool Tip widget (click the buttons to isolate the various relationships between the HTML markup and the fully enabled widget)

Using the provided design templates

The Codify Design Studio team has created a series of widget designs that you can download and customize for your own web projects. The assets include modified HTML and CSS files that are specifically developed to work with the presliced Photoshop files.

For quick and easy customization, simply update the PSD files in either Photoshop or Fireworks, and export the slices to the CodifyAssets folder. If you're a more advanced user, feel free to modify the slice structure, HTML, and CSS files to achieve any design configuration your project requires.

Although it is fast and easy to add widgets in Dreamweaver using the Insert panel, some design techniques require some customization of the HTML and CSS files. In the following video, I walk you through the assets provided at the MAX 2009 conference session, as well as a brief description of the specific HTML and CSS elements that were modified in each Spry widget of the MAX theme:

This content requires Flash To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player. To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Running time: 17:05

Preview and download the templates

Refer to the following figures for a summary of the key features of each template and to preview and download the templates.

Theme Set 1

Theme Set 1

Theme Set 2

Theme Set 2

Theme Set 3

Theme Set 3

Theme Set 4

Theme Set 4

Theme Set 5

Theme Set 5

Theme Set 6

Theme Set 6

Theme Set 7 (MAX 2009)

Theme Set 7 (MAX 2009)

More Like This

  • Excerpt: Bring Your Web Design to Life
  • Understanding HTML5 intelligent forms – Part 1: New input elements
  • Dreamweaver CS5 Missing Manual excerpts: Behaviors, site management, and templates
  • Scripting the web – Part 1: Introduction to JavaScript
  • Getting to know your CSS selectors – Part 1: CSS2.1 and attribute selectors
  • Getting to know your CSS selectors – Part 2: CSS3 pseudo-classes and pseudo-elements
  • Understanding HTML5 intelligent forms – Part 2: New form attributes
  • Creating your first website – Part 1: Set up your site and project files
  • From screen to print: Creating a print CSS in Dreamweaver
  • Building a Spry Sliding Panels widget

Tutorials and samples

Tutorials

  • Mobile app with PhoneGap – Part 7: Submitting to the Apple App Store
  • PhoneGap and Dreamweaver: Releasing on iOS
  • Mobile app with PhoneGap – Part 5: Submitting to Android Market
  • Mobile app with PhoneGap – Part 4: Creating a release build for Android

Samples

  • Responsive design with jQuery marquee
  • Customizable starter design for jQuery Mobile
  • Customizable starter design for HTML5 video
  • Customizable starter design for multiscreen development

Dreamweaver user forum

More
02/07/2012 Any testing server experts out there?
02/07/2012 Another quick CSS layout question - vertical align:middle
01/25/2012 Dreamweaver and CMS
02/07/2012 Cannot insert a background image in an editable ID style

Dreamweaver Cookbook

More
11/07/2011 Simple social networking share buttons
09/20/2011 Registration form that will generate email for registrant to validate
08/21/2011 Spry Accordion - Vertical Text - Auto Start on Page Load - Mouse Over Pause
08/17/2011 Using cfdump anywhere you like

Products

  • Creative Suite
  • Photoshop Family
  • Acrobat Family
  • Flash Platform
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Mobile apps

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • Adobe Store
  • For students and educators
  • For small and medium businesses
  • For enterprises
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • Pacific - English
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy (updated 07-14-2009).

Ad Choices

Reviewed by TRUSTe: site privacy statement