Some of the most advanced Web site features are
created by combining HTML and CSS with more advanced technologies, such
as JavaScript. To help you create these features without having to write
the code yourself, Dreamweaver includes a collection of widgets and
behaviors that you can use on your Web pages. You will find these
features under the Spry menu and in the Behaviors panel.
Behavior Basics
Behaviors are cause-and-effect
events that you can insert into your Web pages. For example, you can
use the Rollover Image behavior to add an image to a page and then
replace that image with another image when a visitor rolls a cursor over
the first image. Similarly, the Open Browser Window behavior causes a
new Web browser window to open when a user clicks or moves the cursor
over an image.
Behaviors and Browsers
Because behaviors vary in
complexity, they are written in various ways to ensure compatibility
with older Web browsers. The latest versions of both Internet Explorer
and Firefox display most of Dreamweaver's behaviors well, and you can
disable behaviors that may not work in older Web browsers.
Behind the Scenes
Dreamweaver creates most behaviors with JavaScript
and creates Spry features, such as drop-down menus, by combining
JavaScript and XML. CSS is also a key component of many of these
advanced features. Even if you are familiar with HTML code, you may be
surprised by how complex JavaScript looks when you view the code behind
your pages.