Knowledge Quest: Behaviors

 

Behaviors are a quick and dirty way to insert JavaScript functionality into your web page without having to learn JavaScript. It's fantastic for web designers who like to make things look pretty but don't necessarily like to learn scripting languages.

The most popular behaviors according to Adobe are:

This report focuses on these four most popular behaviors.

 

Swap Image (Remote Rollovers)

Swap Images allow you to create remote rollovers on a page. You hover your mouse over item A and item B elsewhere on the page changes.

Procedure to create Swap Images:

Pros: This functionality was pretty easy to set up and works well in Firefox and IE.

Cons: Might be confusing the first couple of times. Is very straightforward after you get it right the first time.

 

Set Text of Status Bar

If you’re looking to display explanatory text upon rollover of web elements on a page (text, links, images) you can utilize this feature.

Procedure to create status bar text:

Pros: Can use this relatively simple method to inform the viewer of additional information.

Cons: Does not work in all browsers. Internet Explorer works best, but even then, it doesn't always work. For example, the link text does not work and the status bar does not default to the link location. This function does not work at in Firefox.

 

Open Browser Window

The Open Browser Window allows you to open a new browser window and specify the brower’s size, attributes and name.

Procedure to Open Browser Window:

Pros: This allows us to get around the XHTML Strict rules where target="_blank" doesn't work.

Cons: Popup windows have a bad reputation.

 

Show-Hide Elements

The Show-Hide Elements functionality allows you to hide and/or show elements on a page, provided that all the individual elements are in div containers.

Here are Show-Hide Elements Examples

Procedure to Show/Hide Elements

Pros: easy way to make tabbed interfaces without DHTML or AJAX

Cons: confusing to set up, need to know a little bit of CSS. Also, mouse does not automatically change into a pointer when it rolls over the image/text with a script.

 

Other Built-in Behaviors

The following are the 27 pre-installed Dreamweaver Behaviors:

Pros: easy to use, don't need to know JavaScript

Overall behavior cons: older browsers may not have as many available behaviors. Different browsers will display behaviors differently. While JavaScript is reasonably secure, it is not 100% fail-proof so browsers such as IE might block the script(s).

Behaviors are Extendable

If the above behaviors are not enough, you can add in others. To get them, click on the "+" symbol in the Behaviors panel and select Get More Behaviors... This will bring you to the Acrobat Dreamweaver site where you can read about and download more behaviors. You simply download the files and then follow the installation directions.

Questions

Is this a tool or technique you think you will use in your web development?
Behaviors are easier to use than learning JavaScript. While I am learning JavaScript anyway, I probably will resort to using behaviors because they are so simple to use.

How does it fit into Dreamweaver or web development, or both?
JavaScript is a huge component of web development, as it’s what makes a page interactive. Simplifying the JavaScript so that a non-coder can easily utilize the power of JavaScript is very beneficial to many web designers.

What did you find most challenging / interesting / frustrating about this experience?
I think the most challenging part of the knowledge quest was coming up with a topic. It was one of those “you don’t know what you don’t know until you know you don’t know” scenarios. Once I understood what a behavior was, it was easier to research it.