Creating Mouse over Effect in Images using Javascript

Creating Mouse over Effect in Images using Javascript

<html>

<head>

<script type=”text/javascript”>

function mouseOver()

{

document.logo.src=”blue_logo.gif” mce_src=”blue_logo.gif”

}

function mouseOut()

{

document.logo.src=”pink_logo.gif” mce_src=”pink_logo.gif”

}

</script>

</head>

<body>

<a href=”http://somesite.com” mce_href=”http://somesite.com” target=”_blank”>

<img border=”0″ src=”pink_logo.gif” mce_src=”pink_logo.gif” name=”logo” width=”30″ height=”30″ onmouseover=”mouseOver()” onmouseout=”mouseOut()” /></a>

</body>

</html>

In above example, we are displaying an image link in our we pages. On mouse over we are calling mouseOver() function and changing the image src.

In above case, by default “pink_logo.gif” is shown. On mouse over “blue_logo.gif” will be shown. Again On mouse out we are chaging image to “pink_logo.gif”.

This will give nice look and effect to our web pages.

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.