Menu
I was wondering… ?
Does anyone know a code that can allow me to:
Make it so that when a viewer of the website holds their cursor over image A, both image A and image B show a roll-over (different ones). Is this possible with JavaScript or do I need some other sort of coding?
I’m pretty new to this so keep it sort of simple please.
I’m using Macromedia Dreamweaver 8 if it means anything.
C'mon someone please... You seem to be able to answer easier things than this... Please...[/QUOTE]
function imgSwap(img1, img2) {
if (document.images) {
document.getElementById('image1').src = img1;
document.getElementById('image2').src = img2;
}
}
<img src="photo1.jpg" id="image1" onmouseover="imgSwap('photo1_over.jpg','photo2_over.jpg');" onmouseout="imgSwap('photo1.jpg','photo2.jpg');">
<img src="photo2.jpg" id="image2">
[CODE]<td rowspan="3">
<img src="images/circleintro_08.gif" width="69" height="70" alt=""></td>
<td>[/CODE]
[CODE]<td rowspan="3">
<img src="images/circleintro_07.gif" width="1" height="70" alt=""></td>
<td rowspan="3"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('home_circle','','images/circleintro_home_08.gif',1)"><img src="images/circleintro_08.gif" name="home_circle" width="69" height="70" border="0"></a></td>
<td>[/CODE]
[code=html]
<td rowspan="3">
<img src="images/circleintro_07.gif" width="1" height="70" alt="">
</td>[/code]
[code=html]
<td rowspan="3">
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('home_circle','','images/circleintro_home_08.gif',1)">
<img name="home_circle" src="images/circleintro_08.gif" border="0" width="69" height="70">
</a>
</td>[/code]
[code=html]
<td rowspan="3">
<img name="big_circle" src="images/circleintro_07.gif" border="0" width="1" height="70" alt="">
</td>
<td rowspan="3">
<img name="home_circle" src="images/circleintro_08.gif" border="0" width="69" height="70" alt=""
onMouseOut="MySwapImage(this, 'images/circleintro_08.gif'); return MySwapImage(document.images.big_circle, 'images/circleintro_07.gif');"
onMouseOver="MySwapImage(this, 'images/circleintro_home_08.gif'); return MySwapImage(document.images.big_circle, 'images/circleintro_home_07.gif');">
</td>[/code]
[CODE]
function MySwapImage(img, src)
{
img.src = src;
return true;
}[/CODE]
<td rowspan="3">
<img name="big_circle" src="images/circleintro_07.gif" border="0" width="1" height="70" alt="">
</td>
<td rowspan="3">
<img name="home_circle" src="images/circleintro_08.gif" border="0" width="69" height="70" alt=""
onMouseOut="this.src='images/circleintro_08.gif'; document.images.big_circle.src='images/circleintro_07.gif';"
onMouseOver="this.src='images/circleintro_home_08.gif'; document.images.big_circle.src='images/circleintro_home_07.gif';">
</td>
What are the "returns" in the function and triggers for? Would it not work without those or is it a compatability issue?[/QUOTE]
And, for this poster's sake, it might make sense to get rid of the function completely:[/QUOTE]
return MySwapImage(document.images.big_circle, 'images/circleintro_home_07.gif');">[/QUOTE]
[CODE]
<html>
<head>
<title>circleintro</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('images/circleintro_home_08.gif')">
<!-- ImageReady Slices (circleintro.psd) -->
<table id="Table_01" width="501" height="501" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="9" rowspan="3">
<img src="images/circleintro_01.gif" width="213" height="71" alt=""></td>
<td>
<img src="images/circleintro_02.gif" width="1" height="18" alt=""></td>
<td>
<img src="images/circleintro_03.gif" width="69" height="18" alt=""></td>
<td rowspan="5">
<img src="images/circleintro_04.gif" width="1" height="89" alt=""></td>
<td colspan="7" rowspan="3">
<img src="images/circleintro_05.gif" width="216" height="71" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="18" alt=""></td>
</tr>
<tr>
<td colspan="2">
<img src="images/circleintro_06.gif" width="70" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td rowspan="3">
<img src="images/circleintro_07.gif" width="1" height="70" alt=""></td>
<td rowspan="3"><img src="images/circleintro_08.gif" width="69" height="70"></td>
<td>
<img src="images/spacer.gif" width="1" height="52" alt=""></td>
</tr>
<tr>
<td colspan="2" rowspan="6">
<img src="images/circleintro_09.gif" width="71" height="142" alt=""></td>
<td rowspan="4">
<img src="images/circleintro_10.gif" width="1" height="71" alt=""></td>
<td rowspan="4">
<img src="images/circleintro_11.gif" width="8" height="71" alt=""></td>
<td colspan="3">
<img src="images/circleintro_12.gif" width="62" height="1" alt=""></td>
<td colspan="2" rowspan="2">
<img src="images/circleintro_13.gif" width="71" height="18" alt=""></td>
<td rowspan="17">
<img src="images/circleintro_14.gif" width="70" height="429" alt=""></td>
<td colspan="3" rowspan="5">
<img src="images/circleintro_15.gif" width="71" height="72" alt=""></td>
<td colspan="3" rowspan="6">
<img src="images/circleintro_16.gif" width="75" height="142" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td colspan="3" rowspan="3">
<img src="images/circleintro_17.gif" width="62" height="70" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="17" alt=""></td>
</tr>
<tr>
<td rowspan="2">
<img src="images/circleintro_18.gif" width="1" height="53" alt=""></td>
<td rowspan="15">
<img src="images/circleintro_19.gif" width="70" height="411" alt=""></td>
<td colspan="2">
<img src="images/circleintro_20.gif" width="70" height="1" alt=""></td>
<td rowspan="10">
<img src="images/circleintro_21.gif" width="1" height="328" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td colspan="2" rowspan="7">
<img src="images/circleintro_22.gif" width="70" height="317" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="52" alt=""></td>
</tr>
<tr>
<td colspan="4">
<img src="images/circleintro_23.gif" width="62" height="1" alt=""></td>
<td colspan="2" rowspan="4">
<img src="images/circleintro_24.gif" width="10" height="212" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td colspan="4">
<img src="images/circleintro_25.gif" width="62" height="70" alt=""></td>
<td colspan="3">
<img src="images/circleintro_26.gif" width="71" height="70" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="70" alt=""></td>
</tr>
<tr>
<td rowspan="11">
<img src="images/circleintro_27.gif" width="18" height="287" alt=""></td>
<td colspan="4">
<img src="images/circleintro_28.gif" width="72" height="70" alt=""></td>
<td rowspan="2">
<img src="images/circleintro_29.gif" width="43" height="141" alt=""></td>
<td colspan="2" rowspan="2">
<img src="images/circleintro_30.gif" width="54" height="141" alt=""></td>
<td colspan="3">
<img src="images/circleintro_31.gif" width="70" height="70" alt=""></td>
<td rowspan="11">
<img src="images/circleintro_32.gif" width="22" height="287" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="70" alt=""></td>
</tr>
<tr>
<td colspan="4">
<img src="images/circleintro_33.gif" width="72" height="71"
[/CODE]
[CODE]
alt=""></td>
<td colspan="3">
<img src="images/circleintro_34.gif" width="70" height="71" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="71" alt=""></td>
</tr>
<tr>
<td rowspan="9">
<img src="images/circleintro_35.gif" width="53" height="146" alt=""></td>
<td rowspan="5">
<img src="images/circleintro_36.gif" width="1" height="71" alt=""></td>
<td rowspan="5">
<img src="images/circleintro_37.gif" width="8" height="71" alt=""></td>
<td colspan="3">
<img src="images/circleintro_38.gif" width="62" height="1" alt=""></td>
<td rowspan="5">
<img src="images/circleintro_39.gif" width="1" height="71" alt=""></td>
<td colspan="3">
<img src="images/circleintro_40.gif" width="71" height="1" alt=""></td>
<td rowspan="4">
<img src="images/circleintro_41.gif" width="1" height="63" alt=""></td>
<td rowspan="9">
<img src="images/circleintro_42.gif" width="52" height="146" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td colspan="3" rowspan="4">
<img src="images/circleintro_43.gif" width="62" height="70" alt=""></td>
<td rowspan="4">
<img src="images/circleintro_44.gif" width="1" height="70" alt=""></td>
<td colspan="2" rowspan="4">
<img src="images/circleintro_45.gif" width="70" height="70" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="52" alt=""></td>
</tr>
<tr>
<td rowspan="5">
<img src="images/circleintro_46.gif" width="1" height="71" alt=""></td>
<td>
<img src="images/circleintro_47.gif" width="69" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td rowspan="4">
<img src="images/circleintro_48.gif" width="69" height="70" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="9" alt=""></td>
</tr>
<tr>
<td rowspan="3">
<img src="images/circleintro_49.gif" width="1" height="61" alt=""></td>
<td rowspan="5">
<img src="images/circleintro_50.gif" width="1" height="83" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="8" alt=""></td>
</tr>
<tr>
<td colspan="5">
<img src="images/circleintro_51.gif" width="71" height="1" alt=""></td>
<td rowspan="4">
<img src="images/circleintro_52.gif" width="1" height="75" alt=""></td>
<td colspan="3">
<img src="images/circleintro_53.gif" width="71" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td colspan="5" rowspan="3">
<img src="images/circleintro_54.gif" width="71" height="74" alt=""></td>
<td colspan="3" rowspan="3">
<img src="images/circleintro_55.gif" width="71" height="74" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="52" alt=""></td>
</tr>
<tr>
<td colspan="2">
<img src="images/circleintro_56.gif" width="70" height="1" alt=""></td>
<td rowspan="2">
<img src="images/circleintro_57.gif" width="1" height="22" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td colspan="2">
<img src="images/circleintro_58.gif" width="70" height="21" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="21" alt=""></td>
</tr>
<tr>
<td>
<img src="images/spacer.gif" width="18" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="53" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="8" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="10" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="43" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="9" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="70" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="69" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="70" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="53" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="17" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="52" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="22" height="1" alt=""></td>
<td></td>
</tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>
[/CODE]
0.1.9 — BETA 5.16