|
image links ok so im making a graphics site and i have images as links and i want to make the image have a cute design when you scroll over it so whats the code to make the image change when you scroll over it?
[ ] Want to answer more questions in the Technology category? Maybe give some free advice about: Internet & Web Design?
Here's an example of that effect. I've replaced http colon slash slash with hxxp\ so it doesn't change it into a link:
<html>
<head>
<script type="text/javascript">
function animate()
{
document.advicenators.src ="hxxp\www.google.com/intl/en_ALL/images/logo.gif" /*advicenators is the name of the element I want to change*/
}
function unanimate()
{
document.advicenators.src ="hxxp\www.advicenators.com/img/hsingle.gif"
}
</script>
</head>
<body>
<img src="hxxp\www.advicenators.com/img/hsingle.gif" name="advicenators" onmouseover="animate()" onmouseout="unanimate()" />
<!--onmouseover is triggered when a mouse is over it, but it is NOT changed when a mouse leaves it. So you need onmouseout to change it to it's original -->
</body>
</html>
It switches between the advicenators and google logos. This won't work on myspace, only sites that allow javascript. There's no way to do it without javascript. There might be a more elegant solution for what you need(so you don't have to make two new functions for each image), but I don't want to mess with it right now. ]
More Questions: |