I have a number of layers at the end of my code, each inside a <DIV></DIV> and right before my</BODY>.
I have a function to hide all the layers when my page loads, and another function that takes an ID as an argument and shows that particular layer.
When I look at it all in Explorer, it works fine. When I look at in
Netscape, my JavaScript console says "document.layerwhoare has no
properties" (where "layerwhoare" is the name of my layer). It shows all my layers at the bottom of my page, one after the other (not in position).
I threw this page on my web site for anyone to have a gander at:
Here's are the relevant snipets of my code:
function hideLayers(){
if (document.all){
document.all("layerwhoare".style.visibility = "hidden";
document.all("layerwhatdo".style.visibility = "hidden";
document.all("layerwhyare".style.visibility = "hidden";
document.all("layerwhatabout".style.visibility = "hidden";
}
else{
document.layerwhoare.visibility = "hide";
document.layerwhatdo.visibility = "hide";
document.layerwhyare.visibility = "hide";
document.layerwhatabout.visibility = "hide";
}
}
function openLayer(layer_name){
if (document.all){
document.all[layer_name].style.visibility = "visible";
}
else{
document[layer_name].visibility = "show";
}
}
<style type="text/css">
.test{
position: absolute;
visibility: hidden;
top: 112px;
left: 120px;
}
.main{
position: absolute;
visibility: hidden;
top: 300px;
left: 140px;
}
</STYLE>
<A HREF="#" onClick="openLayer('layerwhoare')">
<IMG SRC="images/whoare_button_over.gif" VSPACE=0 HSPACE=0 BORDER=0>
</A>
<DIV ID="layerwhoare" CLASS="main">
<FONT FACE="Arial" SIZE=2>
<FONT SIZE=4>
<B>Who are the People?</B>
</FONT><BR>
We are mostly younger adults 20-40 years old and their children. We are
people who long to love like <A HREF="whoisJesus.html">Jesus</A> loved,
and do what <A HREF="whoisJesus.html">Jesus</A> did. We are a people of
prayer, who put speaking to the <B>Father</B> above other activities
recognizing <B>He</B> can do so much more than any of us in our own
power.<BR>
<BR>
<CENTER>
<A HREF="believe.html">What do we believe?</A> |
<A HREF="leaders.html">Our Leaders</A><BR>
<A HREF="people.html">The People of Northside Community Church</A> |
<A HREF="where.html">Where do we come from?</A>
</CENTER>
</FONT>
</DIV>
Any suggestions as to why it doesn't work in Netscape? Thanks muchly!
John Hanley
john@jhanley.cjb.net
I have a function to hide all the layers when my page loads, and another function that takes an ID as an argument and shows that particular layer.
When I look at it all in Explorer, it works fine. When I look at in
Netscape, my JavaScript console says "document.layerwhoare has no
properties" (where "layerwhoare" is the name of my layer). It shows all my layers at the bottom of my page, one after the other (not in position).
I threw this page on my web site for anyone to have a gander at:
Here's are the relevant snipets of my code:
function hideLayers(){
if (document.all){
document.all("layerwhoare".style.visibility = "hidden";
document.all("layerwhatdo".style.visibility = "hidden";
document.all("layerwhyare".style.visibility = "hidden";
document.all("layerwhatabout".style.visibility = "hidden";
}
else{
document.layerwhoare.visibility = "hide";
document.layerwhatdo.visibility = "hide";
document.layerwhyare.visibility = "hide";
document.layerwhatabout.visibility = "hide";
}
}
function openLayer(layer_name){
if (document.all){
document.all[layer_name].style.visibility = "visible";
}
else{
document[layer_name].visibility = "show";
}
}
<style type="text/css">
.test{
position: absolute;
visibility: hidden;
top: 112px;
left: 120px;
}
.main{
position: absolute;
visibility: hidden;
top: 300px;
left: 140px;
}
</STYLE>
<A HREF="#" onClick="openLayer('layerwhoare')">
<IMG SRC="images/whoare_button_over.gif" VSPACE=0 HSPACE=0 BORDER=0>
</A>
<DIV ID="layerwhoare" CLASS="main">
<FONT FACE="Arial" SIZE=2>
<FONT SIZE=4>
<B>Who are the People?</B>
</FONT><BR>
We are mostly younger adults 20-40 years old and their children. We are
people who long to love like <A HREF="whoisJesus.html">Jesus</A> loved,
and do what <A HREF="whoisJesus.html">Jesus</A> did. We are a people of
prayer, who put speaking to the <B>Father</B> above other activities
recognizing <B>He</B> can do so much more than any of us in our own
power.<BR>
<BR>
<CENTER>
<A HREF="believe.html">What do we believe?</A> |
<A HREF="leaders.html">Our Leaders</A><BR>
<A HREF="people.html">The People of Northside Community Church</A> |
<A HREF="where.html">Where do we come from?</A>
</CENTER>
</FONT>
</DIV>
Any suggestions as to why it doesn't work in Netscape? Thanks muchly!
John Hanley
john@jhanley.cjb.net