Click to return to the DHTML, HTML     
HOVERSRC Attribute | hove...     Behaviors Library    
Web Workshop  |  DHTML, HTML & CSS

imageRollover Behavior


Provides rollover effects for images.

Syntax

XMLN/A
HTML<IMG STYLE="behavior:url('imagerollover.htc')" ID=sID>
ScriptoImage.style.behavior = "url('imagerollover.htc')"
oImage.addBehavior ("imagerollover.htc")

Possible Values

sID String that uniquely identifies the object.

Members

Remarks

The behavior-defined members listed in the preceding table are not accessible through script until the window.onload event fires. Waiting for this event to fire ensures that the page is completely loaded, that all behaviors have been applied to corresponding elements on the page, and, consequently, that all the behavior's properties, methods, and events are available for scripting. Attempting to use any of the behavior-defined members will result in a scripting error indicating that the object does not support that particular member.

The imageRollover behavior allows Web authors to specify a replacement image to be displayed when the mouse cursor hovers over an IMG object, or when the IMG object is clicked. Use the HOVERSRC and PRESSEDSRC attributes to specify the image sources for the events.

The imageRollover.htc file can be downloaded from the imageRollover sample page.

Example

This sample demonstrates the implementation of the imageRollover behavior to create a toolbar.

Sample Code

<STYLE>
.rollover { behavior : url(imagerollover.htc) }
</STYLE>

<TABLE>
<TR>
<TD>
   <IMG SRC =" back1.jpg"
   HOVERSRC = "back2.jpg"
   PRESSEDSRC = "back3.jpg"
   CLASS="Rollover"
>
</TD></TR>

<!-- Append additional images -->

</TABLE>
This feature requires Internet Explorer 5 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
IMG


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.