| By Paul Gubbay | Article Rating: |
|
| May 19, 2007 02:45 PM EDT | Reads: |
19,581 |
Widget Structure
In our example we use an
Accordion widget to display additional information about the selected
product in the Products table. The structure of the widget is defined
by the HTML code.
As you can see, the composition of the widget is quite easy to understand for anybody familiar with HTML. If you want to add or delete a panel, you can simply add or delete the appropriate HTML container in your code.
Widget Behavior
The functionality for the
Accordion widget is built into a JavaScript file that understands the
HTML structure for the widget. This approach makes it easy for users to
modify the look-and-feel of the widget without having to worry about
its functionality. As long as the HTML structure is correct, the widget
will function as expected. The JavaScript is included using two lines
of code.
The first line simply links in the JavaScript file that contains the Accordion functionality.
The second line creates an instance of the Accordion JavaScript object and links it to the HTML by passing in the user-defined ID (Acc1).
Note that the JavaScript to create an instance of a Spry widget must be included under your markup at the bottom of the Web page.
Widget Styling
The Accordion widget is styled just
as you would any other HTML element on your page using CSS. The CSS
file (SpryAccordion.css) is included using the following line of code:
In the HTML example in Figure 8 you will notice that there are CSS classes applied to each of the relevant block-level elements (Accordion, AccordionPanel, AccordionPanelTab, and AccordionPanelContent). The CSS rules for these classes are defined in the SpryAccordion.css file. They can be changed at will by the Web developer or designer.
Spry Effects
Spry effects are visual enhancements
that you can apply to almost any element on an HTML page. For example,
an effect might highlight information, create animated transitions, or
visually alter a page element for a certain period of time. Effects are
a simple but elegant way of enhancing the look-and-feel of your Web
site.
The current set of effects (so far) includes:
- Appear/Fade
- Highlight
- Blind Up/Blind Down
- Slide Up/Slide Down
- Grow/Shrink
- Shake
- Squish
- Simple JS Syntax.
- Single JS include.
- Compatible with other effect libs/frameworks.
- Focus on key interaction/UE behaviors.
Published May 19, 2007 Reads 19,581
Copyright © 2007 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Paul Gubbay
Paul Gubbay is a director of engineering at Macromedia. Previously, Paul held the role of CEO at CyberSage Software, where he spent several years building the vision and infrastructure of the company. Under Paul's guidance, CyberSage focused on emerging technologies such as XML, Java, and Macromedia Flash to deliver leading edge product offerings.
- Kindle 2 vs Nook
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Moving Your RIA Apps into the Cloud: Seven Challenges
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Windows 7 – Microsoft’s First Step to the Cloud
- Ulitzer Provides a Powerful Social Journalism Platform
- Jill Tummler Singer, Deputy CIO of CIA, Keynotes at GovIT Expo
- Open Source Mobile Cloud Sync and Push Email
- Kindle 2 vs Nook
- The Difference Between Web Hosting and Cloud Computing
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- My Thoughts on Ulitzer
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- US Post Office Hops a Ride on NetSuite’s Cloud
- Moving Your RIA Apps into the Cloud: Seven Challenges
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Building a Drag-and-Drop Shopping Cart with AJAX
- What Is AJAX?
- Google Maps! AJAX-Style Web Development Using ASP.NET
- Flashback to January 2006: Exclusive SYS-CON.TV Interviews on "OpenAjax Alliance" Announcement
- AJAXWorld Conference & Expo to Take Place October 2-4, 2006, at the Santa Clara Convention Center, California
- AJAX Sponsor Webcasts Are Now Available at AJAXWorld Website
- How and Why AJAX, Not Java, Became the Favored Technology for Rich Internet Applications
- "Real-World AJAX" One-Day Seminar Arrives in Silicon Valley
- AJAXWorld University Announces AJAX Developer Bootcamp
- AJAX Support In JadeLiquid WebRenderer v3.1
- Where Are RIA Technologies Headed in 2008?
- Struts Validations Framework Using AJAX




































