PDA

View Full Version : Multiple image roll overs


gildash2
02-23-2004, 09:54 AM
<BODY>
<SCRIPT language="JavaScript">

if (document.images)
{
pic1on= new Image(81,19);
pic1on.src="shoes2.gif";
pic2on= new Image(125,200);
pic2on.src="winter2.jpg";

pic1off= new Image(66,36);
pic1off.src="shoes1.gif";
pic2off= new Image(100,25);
pic2off.src="story1.gif";

}

function lightup(imgName,imgName2)
{
if (document.images)
{
imgOn=eval(imgName + "on.src");
document[imgName].src= imgOn;
imgOn2=eval(imgName2 + "on.src");
document[imgName2].src= imgOn2;
}
}

function turnoff(imgName,imgName2)
{
if (document.images)
{
imgOff=eval(imgName + "off.src");
document[imgName].src= imgOff;
imgOff2=eval(imgName2 + "off.src");
document[imgName2].src= imgOff2;
}
}

//-->
</SCRIPT>
</HEAD>
<BODY>
</A>
<BR>
<A HREF="newpage.html" onMouseover="lightup('pic1','pic2')" onMouseout="turnoff('pic1','pic2')">
<IMG SRC="shoes1.gif" name="pic1" width="81" height="19" border="0">
</A>
<IMG SRC="story1.gif" name="pic2" width="200" height="125" border="0">
</BODY>
hello again, ive been having difficulty adding more that one set of these four images which look like this when the code is put together: http://www.geocities.com/glldash/temporarypreviewfile.html?1077547898234
what i need to do and what ive been having trouble with is adding images so that i could have more than one set of those but still using the same function(or not. What i mean is that i may what a seperate button but want it to do the same thing as the first, how would i add another set of pictures to formt he affect that i hade above? show me what i need to do please, andy and all help will be appreciated
thank you

gildash2
02-23-2004, 10:06 AM
nvm i just answered my own question lo, but thank you to those who were trying to help me