Home
> Dreamweaver
> JavaScript behaviors
JavaScript behaviors
JavaScript behaviors are a great way to expand the capabilities of
your site beyond 'plain vanilla' html. Dreamweaver makes it simple to
add them to your site. You can add behaviors to check a user's browser
version, play sounds, open custom-sized windows, swap images, and more.
This tutorial will show you how to use the swap image behavior to add
mouseover buttons to your site.
Mouseover effects
A common effect used on many Web sites is the onmouseover
behavior. This allows you to swap one image for another when the user
moves their mouse over an image. It's often used on buttons to make
them "light up" or "push in". Below is a quick tutorial
that explains how this is done.
Below are two images that make up the "Lunch" menu link on
the Web site of a fictional restaurant:

We want our button to "light up" and "push in"
when the mouse is over the image. Here's how: