SiteExperts.com Logo Home | Community | Developer's Paradise | Jobs
User Groups | Site Tools | Site Information | Search

Inside Technique : Steve's Behaviors : over Behavior

The over behavior makes it easy to add rollover effects to your elements. With Internet Explorer 5.0 move the mouse over the examples below. In all other browser, the rollover effect is ignored.

Examples

An ANCHOR tag
Sample Text

This is the OVER.htc behavior. This behavior has a different effect depending upon the element:

  • <A> (anchors) - When placed on an anchor tag, it automatically changes the color of the link when the mouse moves over it. You can specify the color with the hoverColor property. Also, you can specify the hoverBorder property which causes the link to appear raised when the mouse moves over it.
  • <IMG> - (images) - When placed on an image tag, it can change the source of the image by specifying a hoverImage property, or you can use the hoverBorder, or both.
  • All Other Tags - All other tags support the hoverBorder property.

The above samples are associated with the over behavior as follows:

<a style="behavior: url(over.htc)" 
   href=# 
   hoverBorder 
   hoverColor=green>An ANCHOR tag
</a>
<div style="text-align: center; 
            behavior: url(over.htc);" 
     hoverBorder>
Sample Text
</div>
<p>
<img style="behavior: url(over.htc)" 
     src="/gifs/ball.gif" 
     hoverImage="/gifs/redball.gif" 
     hoverBorder>

Page 1:Steve's Behaviors
Page 2:move Behavior
Page 3:fade Behavior
Page 4:bubble Behavior
Page 5:type Behavior
Page 6:switch Behavior
Page 7:over Behavior
Page 8:float Behavior