Provides rollover effects for images.
Syntax
XML N/A HTML <IMG STYLE="behavior:url('imagerollover.htc')" ID=sID> Script oImage.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>
Applies To
IMG