...

View Full Version : Image mouseover, Please help can't do!!



new at this
07-07-2007, 09:42 PM
Hello,
I know that this is probably basic stuff for most of you but I have tried many different codes to achieve a image mouseover and not one has worked.

this is the first one that I tried


<SCRIPT LANGUAGE="javascript">

<!--


t4=new image(112,150)
t4.src="tes1.jpg"

2t4=new image(112,150)
2t4.src="Tes2.jpg"



//-->

</SCRIPT>


</HEAD><BODY>

<center>

<A HREF="page2b.html" ONMOUSEOVER="document.TessaT4.src=t4.src" ONMOUSEOUT="doucment.TessaT4.src=2t4.src">

<IMG SRC="tes1.jpg" NAME="TessaT4">
</A>

</body>
all I got was my first image and nothing happened.

I have tried a JavaScript code generator and got nothing, not even an image. on the page.
I have tried many different ways of doing this and still nothing.

Any help would be great
Thanks Erica

Philip M
07-07-2007, 10:11 PM
You will find a good tutorial with examples at:-

http://www.htmlcenter.com/tutorials/tutorials.cfm/79/Javascript/

new at this
07-09-2007, 03:26 AM
Thanks for that Phillip,
It kind of works, when the page first loads I get the little red x where the image is and then when I move my mouse over the spot the image comes up and changes.
this is the code
<html>
<head>
<title>JavaScript Image Rollovers</title>
<script>
<!-- Hide Script
function move_in(img_name,img_src) {
document[img_name].src=img_src;
}

function move_out(img_name,img_src) {
document[img_name].src=img_src;
}
//End Hide Script-->
</script>
</head>
<body>
<a href="#"
OnMouseOver="move_in('image1','tes2.jpg')"
OnMouseOut="move_out('image1','tes1.jpg')">

<img src="tes2.jpgf"
alt="Tessa T4" name="image1">

</a>
</body>
</html>

I will work on it some more to see if I can solve the problem .
Does anybody have any ideas as to where I went wrong????

Thanks again Erica

new at this
07-09-2007, 04:06 AM
Found the problem a simple typo silly me..
Thanks Phillip again

Erica



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum