Lomandriel
01-14-2004, 09:37 AM
Last night I was using a nifty script from the netguide.com.au coding section of their magazine, which is meant to change one picture to another when you put your mouse over it (and linked at the same time. Their example was a green button and purple, weith the green transforming to th epurple when the mouse was put over it, and then you could click it to goto their site: netguide.com.au.
Anyway I tried it and it juset wouldn't work. Most times it would say there's a java error, "o" is not defined etc.
Here is the script/coding I used(do you call it script for java and coding for like html etc?).
<html>
<HEAD>
<script language ="JavaSCript"> <!--
function swapImage(id, image){document.imaged[id].src=image;}
//-->
</script>
<title>Mouse over image event, linked to netguide</title>
</HEAD>
<body>
<a href="http://www.netguide.com.au" onMouseOver="swapImage(o,'Wreath.gif')"
onMouseOut= "swapImage(o,'Mailbox.gif')">
<img src= "mailbox.gif" border ='o'>
</a>
</body>
</html>
What I'm alseo very confused is at the start and end of the document do you use the <html> </html> flags, even if you ptu javascript and no html inside? Or you put both eveN? Because I don't really know, I did try suplementing java inside the tags, but being such a novice javascript designer, iwas left clueless.
All help appreciated
:thumbsup:
Anyway I tried it and it juset wouldn't work. Most times it would say there's a java error, "o" is not defined etc.
Here is the script/coding I used(do you call it script for java and coding for like html etc?).
<html>
<HEAD>
<script language ="JavaSCript"> <!--
function swapImage(id, image){document.imaged[id].src=image;}
//-->
</script>
<title>Mouse over image event, linked to netguide</title>
</HEAD>
<body>
<a href="http://www.netguide.com.au" onMouseOver="swapImage(o,'Wreath.gif')"
onMouseOut= "swapImage(o,'Mailbox.gif')">
<img src= "mailbox.gif" border ='o'>
</a>
</body>
</html>
What I'm alseo very confused is at the start and end of the document do you use the <html> </html> flags, even if you ptu javascript and no html inside? Or you put both eveN? Because I don't really know, I did try suplementing java inside the tags, but being such a novice javascript designer, iwas left clueless.
All help appreciated
:thumbsup: