I'm trying to create a 3 row by 4 column picture array using <div> tags.
Because I want some rollover and click effects, I'm also stacking each cell
entry 3 deep (for a total of 36 <div>s). 12 are initially visible, and the
other two on top become visible upon mouseovers and clicks.
The javascript actions work as they should.
The problem: in Dreamweaver, where I developed this, the 3x4 array is perfect. When browsed with IE and NS, many of the pix are on top of each other. Since the page renders the same in IE and in NS, I'm figuring it's a code problem rather than a browser incompatibility.
For whatever its worth, I did this by making a single cell work as I want, then cut and pasted the code 11 more times, and then modified the position parameters and I started to change out the picture references. The latter step is (obviously) not complete.
Any help would be appreciated (comments about how to shorten the code would be welcome, too!).
The (lengthy!) code follows below:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd"
>
<html>
<head>
<title>What's Laura's Favorite Animal?</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(p
arseInt(ap
pVersion)=
=4)) {
document.MM_pgW=innerW
idth; document.MM_pgH=innerHeigh
t; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_p
gW || innerHeight!=document.MM_p
gH) location.reload();
}
MM_reloadPage(true);
//-->
//the function below shows and hides layers by toggling the visibility state
function showorhide1(imgname,f){
if(f){visi="visible";}
else{visi="hidden";}
if(document.layers){//NS4
document[imgname].visibili
ty=visi;
}
else if(document.all){// IE 4+
document.all[imgname].styl
e.visibili
ty=visi;
}
else if(document.getElementById
){// NS6+
document.getElementById([i
mgname]).s
tyle.visib
ility=visi
;
}
}
// -->
function MM_openBrWindow(theURL,win
Name,featu
res) { //v2.0
window.open(theURL,winNa
me,feature
s);
}
//-->
</SCRIPT>
<link href="../../../common_styl
es.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="titletext" style="position:absolute; width:100%; height:43px; z-index:37; left: 0px; top: 7px;">
<p class="greentitletext">Can
you guess Laura’s favorite animal?</p>
</div>
<!--R1,C1 dinosaur -->
<div id="din1" style="position:absolute; width:175px; height:125px; z-index:3; left: 20; top: 100px; visibility: visible;">
<a href="javascript:void(0)" onMouseOver="showorhide1('
din2',1);"
onMouseOut="showorhide1('d
in2',0);"
onClick="showorhide
1('din3',1
);showorhi
de1('din2'
,0);MM_ope
nBrWindow(
'dinosaurs
-lg.htm','
dinosaurs'
,'scrollba
rs=no,resi
zable=yes,
width=730,
height=600
')">
<img src="dinosaurs-sm.jpg" width="175" height="125" border="0"></a>
</div>
<div id="din2" style="position:absolute; width:175px; height:125px; z-index:2; left: 20; top: 100px; visibility: hidden;">
<a href="javascript:void(0)" onClick="showorhide1('din3
',1);showo
rhide1('di
n2',0);MM_
openBrWind
ow('dinosa
urs-lg.htm
','dinosau
rs','scrol
lbars=no,r
esizable=y
es,width=7
30,height=
600')">
<img src="laheadheart.gif" width="175" height="125" border="0"></a>
</div>
<div id="din3" style="position:absolute; width:175px; height:125px; z-index:1; left: 20px; top: 100px; visibility: hidden;">
<img src="laheadheartno.gif" width="175" height="125" border="0">
</div>
<!--R2,C1 pig -->
<div id="pig1" style="position:absolute; width:175px; height:125px; z-index:6; left: 20; top: 250px; visibility: visible;">
<a href="javascript:void(0)" onMouseOver="showorhide1('
pig2',1);"
onMouseOut="showorhide1('p
ig2',0);"
onClick="showorhide
1('pig3',1
);showorhi
de1('pig2'
,0);MM_ope
nBrWindow(
'pig-lg.ht
m','pigs',
'scrollbar
s=no,resiz
able=yes,w
idth=730,h
eight=600'
)">
<img src="pig-sm.jpg" width="175" height="125" border="0"></a>
</div>
<div id="pig2" style="position:absolute; width:175px; height:125px; z-index:5; left: 20; top: 250px; visibility: hidden;">
<a href="javascript:void(0)" onClick="showorhide1('pig3
',1);showo
rhide1('pi
g2',0);MM_
openBrWind
ow('pig-lg
.htm','pig
s','scroll
bars=no,re
sizable=ye
s,width=73
0,height=6
00')">
<img src="laheadheart.gif" width="175" height="125" border="0"></a>
</div>
<div id="pig3" style="position:absolute; width:175px; height:125px; z-index:4; left: 20; top: 250px; visibility: hidden;">
<img src="laheadheartno.gif" width="175" height="125" border="0">
</div>
<!--R3,C1 elephant -->
<div id="ele1" style="position:absolute; width:175px; height:125px; z-index:9; left: 20; top: 400px; visibility: visible;">
<a href="javascript:void(0)" onMouseOver="showorhide1('
ele2',1);"
onMouseOut="showorhide1('e
le2',0);"
onClick="showorhide
1('ele3',1
);showorhi
de1('ele2'
,0);MM_ope
nBrWindow(
'elephant-
lg.htm','e
lephant','
scrollbars
=no,resiza
ble=yes,wi
dth=600,he
ight=730')
">
<img src="elephant-sm.jpg" width="125" height="175" border="0"></a>
</div>
<div id="ele2" style="position:absolute; width:175px; height:125px; z-index:8; left: 20; top: 400px; visibility: hidden;">
<a href="javascript:void(0)" onClick="showorhide1('ele3
',1);showo
rhide1('el
e2',0);MM_
openBrWind
ow('elepha
nt-lg.htm'
,'pigs','s
crollbars=
no,resizab
le=yes,wid
th=600,hei
ght=730')"
>
<img src="laheadheart.gif" width="175" height="125" border="0"></a>
</div>
<div id="ele3" style="position:absolute; width:175px; height:125px; z-index:7; left: 20; top: 400px; visibility: hidden;">
<img src="laheadheartno.gif" width="175" height="125" border="0">
</div>
<!--R1,C2 dog -->
<div id="dog1" style="position:absolute; width:175px; height:125px; z-index:12; left: 215; top: 100px; visibility: visible;">
<a href="javascript:void(0)" onMouseOver="showorhide1('
din2',1);"
onMouseOut="showorhide1('d
in2',0);"
onClick="showorhide
1('din3',1
);showorhi
de1('din2'
,0);MM_ope
nBrWindow(
'dinosaurs
-lg.htm','
dinosaurs'
,'scrollba
rs=no,resi
zable=yes,
width=730,
height=600
')">
<img src="dinosaurs-sm.jpg" width="175" height="125" border="0"></a>
</div>
<div id="dog2" style="position:absolute; width:175px; height:125px; z-index:11; left: 215; top: 100px; visibility: hidden;">
<a href="javascript:void(0)" onClick="showorhide1('din3
',1);showo
rhide1('di
n2',0);MM_
openBrWind
ow('dinosa
urs-lg.htm
','dinosau
rs','scrol
lbars=no,r
esizable=y
es,width=7
30,height=
600')">
<img src="laheadheart.gif" width="175" height="125" border="0"></a>
</div>
<div id="dog3" style="position:absolute; width:175px; height:125px; z-index:10; left: 215; top: 100px; visibility: hidden;">
<img src="laheadheartno.gif" width="175" height="125" border="0">
</div>
<!--R2,C2 cow -->
<div id="cow1" style="position:absolute; width:175px; height:125px; z-index:15; left: 215; top: 250px; visibility: visible;">
<a href="javascript:void(0)" onMouseOver="showorhide1('
pig2',1);"
onMouseOut="showorhide1('p
ig2',0);"
onClick="showorhide
1('pig3',1
);showorhi
de1('pig2'
,0);MM_ope
nBrWindow(
'pig-lg.ht
m','pigs',
'scrollbar
s=no,resiz
able=yes,w
idth=730,h
eight=600'
)">
<img src="pig-sm.jpg" width="175" height="125" border="0"></a>
</div>
<div id="cow2" style="position:absolute; width:175px; height:125px; z-index:14; left: 215; top: 250px; visibility: hidden;">
<a href="javascript:void(0)" onClick="showorhide1('pig3
',1);showo
rhide1('pi
g2',0);MM_
openBrWind
ow('pig-lg
.htm','pig
s','scroll
bars=no,re
sizable=ye
s,width=73
0,height=6
00')">
<img src="laheadheart.gif" width="175" height="125" border="0"></a>
</div>
<div id="cow3" style="position:absolute; width:175px; height:125px; z-index:13; left: 215; top: 250px; visibility: hidden;">
<img src="laheadheartno.gif" width="175" height="125" border="0">
</div>
<!--R3,C2 gorilla -->
<div id="gor1" style="position:absolute; width:175px; height:125px; z-index:18; left: 215; top: 400px; visibility: visible;">
<a href="javascript:void(0)" onMouseOver="showorhide1('
gor2',1);"
onMouseOut="showorhide1('g
or2',0);"
onClick="showorhide
1('gor3',1
);showorhi
de1('gor2'
,0);MM_ope
nBrWindow(
'gregory-l
g.htm','go
rilla','sc
rollbars=n
o,resizabl
e=yes,widt
h=600,heig
ht=730')">
<img src="gregory-sm.jpg" width="128" height="160" border="0"></a>
</div>
<div id="gor2" style="position:absolute; width:175px; height:125px; z-index:17; left: 215; top: 400px; visibility: hidden;">
<a href="javascript:void(0)" onClick="showorhide1('gor3
',1);showo
rhide1('go
r2',0);MM_
openBrWind
ow('gregor
y-lg.htm',
'gorilla',
'scrollbar
s=no,resiz
able=yes,w
idth=730,h
eight=600'
)">
<img src="laheadheart.gif" width="175" height="125" border="0"></a>
</div>
<div id="gor3" style="position:absolute; width:175px; height:125px; z-index:16; left: 215; top: 400px; visibility: hidden;">
<img src="laheadheartno.gif" width="175" height="125" border="0">
</div>
<!--R1,C3 fish -->
<div id="fish1" style="position:absolute; width:175px; height:125px; z-index:21; left: 410px; top: 100px; visibility: visible;">
<a href="javascript:void(0)" onMouseOver="showorhide1('
din2',1);"
onMouseOut="showorhide1('d
in2',0);"
onClick="showorhide
1('din3',1
);showorhi
de1('din2'
,0);MM_ope
nBrWindow(
'dinosaurs
-lg.htm','
dinosaurs'
,'scrollba
rs=no,resi
zable=yes,
width=730,
height=600
')">
<img src="dinosaurs-sm.jpg" width="175" height="125" border="0"></a>
</div>
<div id="fish2" style="position:absolute; width:175px; height:125px; z-index:20; left: 410px; top: 100px; visibility: hidden;">
<a href="javascript:void(0)" onClick="showorhide1('din3
',1);showo
rhide1('di
n2',0);MM_
openBrWind
ow('dinosa
urs-lg.htm
','dinosau
rs','scrol
lbars=no,r
esizable=y
es,width=7
30,height=
600')">
<img src="laheadheart.gif" width="175" height="125" border="0"></a>
</div>
<div id="fish3" style="position:absolute; width:175px; height:125px; z-index:19; left: 410px; top: 100px; visibility: hidden;">
<img src="laheadheartno.gif" width="175" height="125" border="0">
</div>
<!--R2,C3 goat -->
<div id="goat1" style="position:absolute; width:175px; height:125px; z-index:24; left: 410px; top: 250px; visibility: visible;">
<a href="javascript:void(0)" onMouseOver="showorhide1('
pig2',1);"
onMouseOut="showorhide1('p
ig2',0);"
onClick="showorhide
1('pig3',1
);showorhi
de1('pig2'
,0);MM_ope
nBrWindow(
'pig-lg.ht
m','pigs',
'scrollbar
s=no,resiz
able=yes,w
idth=730,h
eight=600'
)">
<img src="pig-sm.jpg" width="175" height="125" border="0"></a>
</div>
<div id="goat2" style="position:absolute; width:175px; height:125px; z-index:23; left: 410px; top: 250px; visibility: hidden;">
<a href="javascript:void(0)" onClick="showorhide1('pig3
',1);showo
rhide1('pi
g2',0);MM_
openBrWind
ow('pig-lg
.htm','pig
s','scroll
bars=no,re
sizable=ye
s,width=73
0,height=6
00')">
<img src="laheadheart.gif" width="175" height="125" border="0"></a>
</div>
<div id="goat3" style="position:absolute; width:175px; height:125px; z-index:22; left: 410px; top: 250px; visibility: hidden;">
<img src="laheadheartno.gif" width="175" height="125" border="0">
</div>
<!--R3,C3 grizzly bear -->
<div id="bear1" style="position:absolute; width:175px; height:125px; z-index:27; left: 410px; top: 400; visibility: visible;">
<a href="javascript:void(0)" onMouseOver="showorhide1('
pig2',1);"
onMouseOut="showorhide1('p
ig2',0);"
onClick="showorhide
1('pig3',1
);showorhi
de1('pig2'
,0);MM_ope
nBrWindow(
'pig-lg.ht
m','pigs',
'scrollbar
s=no,resiz
able=yes,w
idth=730,h
eight=600'
)">
<img src="pig-sm.jpg" width="175" height="125" border="0"></a>
</div>
<div id="bear2" style="position:absolute; width:175px; height:125px; z-index:26; left: 410px; top: 400; visibility: hidden;">
<a href="javascript:void(0)" onClick="showorhide1('pig3
',1);showo
rhide1('pi
g2',0);MM_
openBrWind
ow('pig-lg
.htm','pig
s','scroll
bars=no,re
sizable=ye
s,width=73
0,height=6
00')">
<img src="laheadheart.gif" width="175" height="125" border="0"></a>
</div>
<div id="bear3" style="position:absolute; width:175px; height:125px; z-index:25; left: 410px; top: 400; visibility: hidden;">
<img src="laheadheartno.gif" width="175" height="125" border="0">
</div>
<!--R1,C4 giraffe -->
<div id="giraffe1" style="position:absolute; width:175px; height:125px; z-index:30; left: 605px; top: 100px; visibility: visible;">
<a href="javascript:void(0)" onMouseOver="showorhide1('
din2',1);"
onMouseOut="showorhide1('d
in2',0);"
onClick="showorhide
1('din3',1
);showorhi
de1('din2'
,0);MM_ope
nBrWindow(
'dinosaurs
-lg.htm','
dinosaurs'
,'scrollba
rs=no,resi
zable=yes,
width=730,
height=600
')">
<img src="dinosaurs-sm.jpg" width="175" height="125" border="0"></a>
</div>
<div id="giraffe2" style="position:absolute; width:175px; height:125px; z-index:29; left: 605px; top: 100px; visibility: hidden;">
<a href="javascript:void(0)" onClick="showorhide1('din3
',1);showo
rhide1('di
n2',0);MM_
openBrWind
ow('dinosa
urs-lg.htm
','dinosau
rs','scrol
lbars=no,r
esizable=y
es,width=7
30,height=
600')">
<img src="laheadheart.gif" width="175" height="125" border="0"></a>
</div>
<div id="giraffe3" style="position:absolute; width:175px; height:125px; z-index:28; left: 605px; top: 100px; visibility: hidden;">
<img src="laheadheartno.gif" width="175" height="125" border="0">
</div>
<!--R2,C4 snake -->
<div id="snake1" style="position:absolute; width:175px; height:125px; z-index:33; left: 605px; top: 250px; visibility: visible;">
<a href="javascript:void(0)" onMouseOver="showorhide1('
pig2',1);"
onMouseOut="showorhide1('p
ig2',0);"
onClick="showorhide
1('pig3',1
);showorhi
de1('pig2'
,0);MM_ope
nBrWindow(
'pig-lg.ht
m','pigs',
'scrollbar
s=no,resiz
able=yes,w
idth=730,h
eight=600'
)">
<img src="pig-sm.jpg" width="175" height="125" border="0"></a>
</div>
<div id="snake2" style="position:absolute; width:175px; height:125px; z-index:32; left: 605px; top: 250px; visibility: hidden;">
<a href="javascript:void(0)" onClick="showorhide1('pig3
',1);showo
rhide1('pi
g2',0);MM_
openBrWind
ow('pig-lg
.htm','pig
s','scroll
bars=no,re
sizable=ye
s,width=73
0,height=6
00')">
<img src="laheadheart.gif" width="175" height="125" border="0"></a>
</div>
<div id="snake3" style="position:absolute; width:175px; height:125px; z-index:31; left: 605px; top: 250px; visibility: hidden;">
<img src="laheadheartno.gif" width="175" height="125" border="0">
</div>
<!--R3,C4 rhino -->
<div id="rhino1" style="position:absolute; width:175px; height:125px; z-index:36; left: 605px; top: 400; visibility: visible;">
<a href="javascript:void(0)" onMouseOver="showorhide1('
pig2',1);"
onMouseOut="showorhide1('p
ig2',0);"
onClick="showorhide
1('pig3',1
);showorhi
de1('pig2'
,0);MM_ope
nBrWindow(
'pig-lg.ht
m','pigs',
'scrollbar
s=no,resiz
able=yes,w
idth=730,h
eight=600'
)">
<img src="pig-sm.jpg" width="175" height="125" border="0"></a>
</div>
<div id="rhino2" style="position:absolute; width:175px; height:125px; z-index:35; left: 605px; top: 400; visibility: hidden;">
<a href="javascript:void(0)" onClick="showorhide1('pig3
',1);showo
rhide1('pi
g2',0);MM_
openBrWind
ow('pig-lg
.htm','pig
s','scroll
bars=no,re
sizable=ye
s,width=73
0,height=6
00')">
<img src="laheadheart.gif" width="175" height="125" border="0"></a>
</div>
<div id="rhino3" style="position:absolute; width:175px; height:125px; z-index:34; left: 605px; top: 400; visibility: hidden;">
<img src="laheadheartno.gif" width="175" height="125" border="0">
</div>
</body>
</html>