Visibility transition - cross-browser

by "Andrew Armstrong" <andrew(at)wisca.co.uk>

 Date:  Sat, 25 Aug 2001 14:10:16 +0100
 To:  <hwg-techniques(at)mail.hwg.org>
  todo: View Thread, Original
I have been doing a visibility transition to work in IE and Netscape by
testing which browser the page was in. I would like to test for the
appropriate object instead, in order to work correctly wherever is possible.
I am probably being dim here, but what should the tests be? I think one test
should be for document.all, but even if so, what do I test to discover if I
need document.elementName.document.all.elementName.style or just
document.all.elementName.style unless I test for a specific element name?
The present code says:

bName = navigator.appName;
bVer = parseInt(navigator.appVersion);
isNS=(bName=='Netscape');

if ((bName == "Netscape" && bVer>= 3) ||
(bName == "Microsoft Internet Explorer" && bVer >= 4)) br = "ok";
else br = "old";

function visible(name){

if (br=="ok"){
var fred= (isNS)? "document."+name:"document.all."+name+".style";
eval(fred).visibility="visible";
}
}

function invisible(name){
if (br=="ok"){
var fred= (isNS)? "document."+name:"document.all."+name+".style";
eval(fred).visibility="hidden";
}
}

Andrew (who is becoming confused)
andrew(at)wisca.co.uk

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA