Netscape 7

Giganews Newsgroups
Subject: Netscape 7
Posted by:  Ingmund Sjåstad (ingmu…@sjaastad.no)
Date: Wed, 9 Jul 2003

This scipt is working in IE6 but not in Netscape 7. What am I doin wrong?

<script language="JavaScript" type="text/JavaScript">

var ns = false;
var ie = false;

ie = (document.all) ? true : false;
ns = (document.layers) ? true : false

function hideLayer(layerName) {
  if (ie){
    document.all(layerName).style.visibility="hidden";
    document.all(layerName).style.width="16";
    document.all(layerName).style.height="16";
  } else if (ns) {
    document.layers[layerName].visibility = "hide";
    document.layers[layerName].width="16";
    document.layers[layerName].height="16";
  }
}

function showLayer(layerName) {
  if (ie){
    document.all(layerName).style.visibility="visible";
    document.all(layerName).style.width="140";
    document.all(layerName).style.height="400";
  } else if (ns) {
    document.layers[layerName].visibility = "show";
    document.layers[layerName].width="140";
    document.layers[layerName].height="400";
  }
}

</script>

--

___________________________
Best Regards,

Ingmund Sjåstad
ingmu…@stadmek.no

Replies