DHTML in IE

by "Harshdeep S. Jawanda" <harsh(at)pspl.co.in>

 Date:  Thu, 17 Feb 2000 15:45:30 +0530
 To:  HWG Techniques <hwg-techniques(at)hwg.org>
todo: View Thread, Original


Hi,

Please have a look at the javascript function whose listing is
given below. In this function, based on the selected value of a
drop down list, I am trying to make one of 4 layers visible, while
making the other three invisible.

It works in NN (surprise! surprise! :-), but not in IE. How does
one access the equivalent of the visibility property (as defined
in the Netscape DOM) of a layer in IE? Can anybody point me to the
IE equivalent of Netscape's "Javascript Client Side Reference
Guide"?

function changeLayer(theObject) {
   var layerArr;
   if (document.all) {
     layerArr = document.all;
   }
   else {
     layerArr = document.layers;
   }
   var index = theObject.selectedIndex;
   for (i = 0; i < 4 ; i++) {
     var layerId2 = "LAYER" + (i+1);
   if (i != index)
     if (document.all)
         layerArr[layerId2].style.display = "none";
     else
         layerArr[layerId2].visibility = "hide";
   else
     if (document.all)
         layerArr[layerId2].style.display = "show";
     else
         layerArr[layerId2].visibility = "show";
   self.status = theObject.options[index].text;
   return false;
}

--
Regards,
Harshdeep Singh Jawanda.

HTML Writers Guild: hwg-techniques mailing list archives maintained by Gerald Oskoboiny