Click to See Complete Forum and Search --> : combining link hover buttons
dd014
12-01-2002, 04:59 PM
Can someone please help me with this if it's possible:
I'm trying to combine 2 types of hover buttons -
basically I want one button to change into another image AND change another image beside it at the same time, when the mouse cursor passes over it
Is this possible?
I know how to do each effect separately but not in combination.
Please help :)
Exuro
12-02-2002, 12:21 AM
I think I know what you're saying, but it would be helpful if you'd give links to examples. Anyway, I think all you need is a comma.
onMouseOver="document.img1.src='bla2.gif',document.img2.src='bla2.gif'"
So you just put a comma between the little actions. You can throw in as many as you want as long as you separate them with commas. Hope that helped! :)
dd014
12-03-2002, 11:11 PM
ok...i'm using this type of script
(as u can probably tell i don't know much about javascript...i just used the first code i found on the net):
if (document.images)
{
pic1on= new Image(100,100);
pic1on.src="f1.jpg";
function lightup(imgName)
{
if (document.images)
{
imgOn=eval(imgName + "on.src");
document[imgName].src= imgOn;
}
}
function turnoff(imgName)
{
if (document.images)
{
imgOff=eval(imgName + "off.src");
document[imgName].src= imgOff;
}
that's in the head portion (just an example of one)
and this is how i TRIED to combine them in the html portion:
<A HREF="r.html" onMouseover="lightup('pic2','pic10')" onMouseout="turnoff('pic2','pic10')">
<IMG SRC="r.jpg" name="pic2" width="100" height="100" border="0"></A>
dd014
12-03-2002, 11:16 PM
and BTW the image that I want to change at the same time is posted in another part of the site...
hmmm maybe thats my problem....:confused:
ok i think I'm gonna end up answering my own question :rolleyes: