28. October 2009 23:38
- onMouseOver- This event will cause something to happen when the mouse moves over the element with the onMouseOver call.
- onMouseOut-This event is the opposite of onMouseOver. It triggers an event when the mouse pointer leaves an element’s area.
These two are usually combined to create animation effects with picture rollovers and text changes.
An example of using onMouseOver and onMouseOut
<script type="text/javascript"></script>
<a href=""onMouseOver="document.image1.src='picture2.jpg;" onMouseOut="document.image1.src='picture1.jpg’;"> <img src="picture1.jpg" name="image1"/></a>
onMouseOver sets the alternate picture that will show when the mouse pointer enters the element area, onMouse out sets the picture back to the default picture that is initially on the page.
To refer to the picture it must be given and id tag, in this case "image1".
An example of using onMouseOver and onMouseOut
8d420f20-340c-4503-b3ff-ab3d555aee6b|1|3.0