SQL PHP HTML ASP JavaScript articles and free scripts to download
 

Image changing onMouseOver & Out by JavaScript

We can use onMouseOver and onMouseOut events to swap images and create an image rollover navigational links. Using this when mouse is passed over the link we can display another image.

This is done by using two images. One image is displayed first as a hyper link and with the help of onMouseOut event the other image is displayed. Here are two images



Here is the demo of on Mouse Over and on Mouse out event on a image hyper link



Here is the code of the above demo

<A HREF="../" onmouseover="document.my_image.src=''images/wrong.jpg''"
onmouseout="document.my_image.src=''images/correct.jpg''" ><img src=images/correct.jpg name=my_image border=''0''></a>

Using this technique a push button type image button can be developed. On button is first displayed and the second button with Push effect is displayed once the mouse is placed over it.


Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked


Join Our Email List
Email:  
For Email Newsletters you can trust
Event Handling