- Joined
- Apr 29, 2005
- Messages
- 6,400
- Reaction score
- 130
well this is my code, but for some reason it doesn't work, if someone can point out the flaw i would be really gratefull
-note, home.jpg is the original image, home2.jpg is the image that needs to be replaced when the mouse goes over it
Code:
<head>
<script language="JavaScript" type="text/javascript">
<!--
if (document.images) {
homebuttonup = new Image();
homebuttonup.src = "home.jpg" ;
homebuttondown = new Image() ;
homebuttondown.src = "home2.jpg" ;
aboutbuttonup = new Image();
aboutbuttonup.src = "aboutbutton.gif" ;
aboutbuttondown = new Image() ;
aboutbuttondown.src = "aboutbuttondown.gif" ;
}
function buttondown( home2 )
{
if (document.images) {
document[ home2 ].src = eval( home2 + "down.src" );
}
}
function buttonup ( buttonname )
{
if (document.images) {
document[ home ].src = eval( home + "up.src" );
}
}
// -->
</script>
</head>
<a href="index.html"
onmouseover="buttondown('home.jpg')"
onmouseout="buttonup('home2.jpg')">
<img src="home.jpg" name="home2" border="0" id="home2" style="position: absolute; left: 624px; top: 157px;" /></a>
-note, home.jpg is the original image, home2.jpg is the image that needs to be replaced when the mouse goes over it

