Click to See Complete Forum and Search --> : javascript!!!
y2jack
03-10-2003, 07:05 PM
I was wondering if anyone knew where to get a script similar to the one on nbc.com. Its a roll over script, where a the cursor is placed over a link and it changes an image in a designated area. Let me know please...gatsby@hotmail.com
Look at this code:
<html>
<head>
<title>Rollover</title>
<script language="javascript" type="text/javascript">
one = new Image()
one.src = "rollover1.gif";
two = new Image()
two.src = "rollover2.gif";
function rollover(img)
{
document.img1.src=img.src;
}
function rolloff()
{
document.img1.src="startimage.gif";
}
</script>
</head>
<body>
<img src="startimage.gif" name="img1"><br>
<a href="yourlink.htm" onmouseover="rollover(one);" onmouseout="rolloff();">One</a><br>
<a href="yourotherlink.htm" onmouseover="rollover(two);" onmouseout="rolloff();">Two</a><br>
</body>
</html>