...

View Full Version : Text change on image rollover?



mmendo
04-20-2005, 01:04 AM
I am doing a simple javascript rollover where an image in the left part of the page changes based on the image rolled over in the right part of the page. I would also like to have a small text description appear below the image on the left based on which image on the right is being rolled over. Can anyone point me in the right direction?

Thanks,
Nicole

warhammerdude20
04-20-2005, 01:32 AM
Sure,




<html>
<head>
<title>Page</title>
<script language=javascript>

function changeImgAndDiscription(discription,img){
window.document.getElementById("changing_text").innerHTML=""+
discription+"";

window.document.the_image.src=img;
}

</script>
</head>
<body>

<img src="the_image.gif" name="the_image">
<p id="changing_text">Here is the discription</p>

<img src="img1.gif" onMouseOver="changeImgAndDiscription(
'this is image 1','img1.gif');">
<img src="img2.gif">
<img src="img3.gif">

</body>
</html>



That would do it...

mmendo
04-20-2005, 06:56 PM
Works beautifully!! Thanks so much!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum