Re: hiding and showing layers in IE???

> document.layer1.visibility = "hide";

It don't work not only in IE, in Netscape 6 too!
document.layers is not supported in IE and new NC, but you can use this
universal
function for setup layer:

function setObj(x) {
  var isNC=false;
  var isNC5=false;
  var vernum = parseInt(navigator.appVersion.charAt(0));
  var vendor = navigator.appName;
  if (vendor == "Netscape") isNC=true;
  if (isNC && (vernum>=5)) isNC5=true;
  var obj = eval(" (isNC) ? ( (isNC5) ? document.getElementById('"+x+"').style
: document."+x+" ) : document.all."+x+".style;");
  return obj;
 }

And call it like this:

var obj1= setObj('layer1');  // obj1 now refer to layer1
obj1.visibility='visible';   //make layer1 visible
obj1.visibility='hidden';   //make layer1 unvisible

This is working in all 4+ browsers!

Serge.
--
http://www.snkey.net

Received on Friday, 30 June 2000 02:14:02 UTC