PDA

View Full Version : Double Rollover Effect



Confuzzled
February 24th, 2002, 21:46
I have my site set up so that it has links in the form of pictures that have rollover effects. This works so far. Now I'm trying to get a entirely seperate image to have a rollover effect at the same time my links have a rollover effect, in a sense a double rollover. My question is, is what is the correct JS for this type of effect. I'm fairly new to JS and don't know much about it but I've been trying to troubleshoot using an example script I pulled off of a site but so far I've only seen a script that either does either a rollover on the seperate image or the links but not both. Maybe I just need a fresh start tomorrow but if anyone has any comments here's an example of my script:



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<CENTER>
<TABLE>
<TR><TD align=right>
<img src="images/map.gif" width="478" height="93" border="0" USEMAP="#menu_main">
<MAP NAME="menu_main">
<TR><TD><SCRIPT LANGUAGE="JavaScript">
<!--
Image1= new Image(70,70)
Image1.src = "/images/linkhome.gif"
Image2 = new Image(70,70)
Image2.src = "images/linkhome2.gif"

function SwapOut() {
document.src = Image2.src; return true;
}

function SwapBack() {
document.src = Image1.src; return true; }

//-->
</SCRIPT>
</TD></TR>

<AREA SHAPE=RECT COORDS="0,27,113,39" HREF="../main/home.htm" onmouseover="SwapOut(); window.status='[Home]';
return true" onMouseOut="SwapBack()"; window.status=''; return true" target="Main">
</table>
</body>
</html>