Chapter 10. Adding Interactivity with Behaviors

In This Chapter

  • Adding behaviors to your Web page

  • Creating image rollovers

  • Using the Swap Image behavior

  • Launching a new browser window

  • Editing your behaviors

  • Enhancing Dreamweaver with extensions

Want to add cool effects like rollovers and pop-up windows? Dreamweaver's behaviors make it easier than ever to create these kinds of interactive features with a JavaScript scripting language.

Behaviors are ready-to-use scripts that can be customized to create a variety of features. You can apply behaviors to almost any element on an HTML page and even to the entire page itself. For example, you can use the Swap Image feature to create an interactive slide show or the Open Browser Window option to play a video in a small, separate browser window.

In this chapter, I introduce you to the Behaviors panel and show you how to use some of Dreamweaver's most popular options.

Brushing Up on Behavior Basics

When you start working with behaviors in Dreamweaver, you can get up and running more easily if you start with this basic introduction to how they work and the terminology they use. When you set up a behavior, you can choose from a number of triggers, or events, such as OnMouseOver or OnClick. Consider this slightly corny example: If you tickle someone and make the person laugh, you used an event to trigger an action. Dreamweaver would call the tickling the event and the laughter the action. The combination is a Dreamweaver behavior.

You may already be familiar ...

Get Dreamweaver CS4 For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.