80 likes | 245 Views
Working With Spry Widgets. Sweeney Ch. 8. Remember…. A Spry widget is a page element that provides a richer user experience by enabling user interaction. A Spry widget comprises the following parts: Widget structure An HTML code block that defines the structural composition of the widget.
E N D
Working With Spry Widgets Sweeney Ch. 8
Remember… • A Spry widget is a page element that provides a richer user experience by enabling user interaction. A Spry widget comprises the following parts: • Widget structure An HTML code block that defines the structural composition of the widget. • Widget behavior JavaScript that controls how the widget responds to user-initiated events. • Widget styling CSS that specifies the appearance of the widget.
Inserting a Widget • When you insert a widget, Dreamweaver automatically includes the necessary Spry JavaScript and CSS files in your site when you save the page.
Styling Widgets • Locate the appropriate CSS file for the widget in the SpryAssets folder of your site, and edit the CSS according to your preferences.
Customizing and Creating “+” • There are many more web widgets available than the Spry widgets that install with Dreamweaver. The Adobe Exchange provides web widgets that have been developed by other creative professionals. • Choose Browse for Web Widgets from the Extend Dreamweaver menu in the Application bar.
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.
A Tooltip widget consists of the following three elements: • The tooltip container. This is the element that contains the message or content that you want to display when the user activates the tooltip. • The page element(s) that activates the tooltip. • The constructor script. This is JavaScript that tells Spry to create the tooltip functionality.
Tidbits… • You should keep the following points in mind when working with the Tooltip widget: • Any open tooltip will close before the next one opens. • Tooltips persist while users hover over the trigger area. • There are no limitations as to what kinds of tags you can use for triggers and for tooltip content. (Block level elements are always advisable, however, to avoid possible cross-browser rendering problems.) • By default, the tooltip appears 20 pixels down and to the right of the cursor. You can use the offsetX and offsetY options to set a custom appearance point. • You must place both trigger and tooltip HTML code before the constructor script. • Currently there is no way to have a tooltip open when a page loads in a browser.