With the help of JavaScript and html we create a "Rollover with a mouse event" function. Here we have two images. when we place mouse over image(1), the image(1) changes to image (2) and when we move the mouse away from that image, the original image,( i.e. image(1) ) gets displayed again.
Code Sample:
<script type="text/javascript">
if(document.images){
var image1 = new Image();
image1.src = "img/images (1).jpg";
var image2 = new Image();
image2.src = "img/images (2).jpg";
}
</script>
<body>
<a href="#" onMouseOver="document.myImage.src=image2.src;"
onMouseOut="document.myImage.src=image1.src;">
<img name="myImage" src="img/images (1).jpg" />
</a>
</body>
0 Comment(s)