Javascript mouseover image failure
Posted
by
CaptainTeancum
on Stack Overflow
See other posts from Stack Overflow
or by CaptainTeancum
Published on 2012-11-04T04:55:09Z
Indexed on
2012/11/04
5:00 UTC
Read the original article
Hit count: 79
This is what I have so far, I have been watching a ton of Javascript videos and I feel I mimicked them solid but this is still not functioning as I want.
Than being, it changes from logo1 to logo2 on mousover. This is homework. However homework that is important to me so any help or guidance would be appreciated.
</head>
<body>
<p>
<div>
<script type="text/javascript">
// Pre load images for rollover
function imgOver(id)
{
document.getElementById(id).src="logo1.jpg";
}
function imgOut(id)
{
document.getElementById(id).src="logo2.jpg";
}
</script>
<a href="#" onmouseover="imgOver('logo1');" onmouseout="imgOut('logo2')">
<img alt="logo" height="150" src="images/Logo1.jpeg" width="110" />
</a>
</div>
</body>
</html>
© Stack Overflow or respective owner