View Full Version : Change pic when mouse over


Dolan
08-10-2003, 03:28 PM
I have a script that's supposed to change pic when mouse is over, but there's something wrong with it. Pls help.
-------------------------
<SCRIPT LANGUAGE="JavaScript">
var pic = new Image();
pic.src = "ankare2.gif";
pic.src = "ankare3.gif";

function visaBild(bildNamn,bildURL) (
document[bildNamn].src = bildURL);
</SCRIPT>

...

<a href="http://www.skepp.com/"
onMouseover="visaBild('a','ankare2.gif');"
onMouseout="visaBild('a','ankare3.gif');">
<IMG NAME= "a" src="ankare3.GIF" width="60" height="57" border="0" >

-----------------------------

stargrl329
08-10-2003, 03:32 PM
hmm.. i don't really understand the purpose of the first part of the script. simply using this code in your body tag should work...

<a href="http://www.skepp.com/"
onMouseover="document.a.src=''ankare2.gif';"
onMouseout="document.a.src='ankare3.gif';">
<img name="a" src="ankare3.GIF" width="60" height="57" border="0"></a>

i'm assuming this is the effect you are going for.. if not, i must have misunderstood.. sorry :(

Dolan
08-10-2003, 03:59 PM
Still doesn't change pic for me when I move my mouse over the pic...

Stormx
08-12-2003, 04:24 PM
That mouseover script loads the images when u put the mouse over it. Meaning it will take a while to load

Use Lissa's script

HAIL LISSA

fawkes
08-16-2003, 01:43 PM
try this <img src="before.gif" hsrc="after.gif">