Question on mouseovers
Thomas Dowling
tdowling at ohiolink.edu
Thu Jan 24 16:37:02 EST 2002
[Apologies if this goes out twice. I seem to have activated Eudora's
clever "Don't actually send this" filter on some mail.]
>>Like this? http://www.lib.rpi.edu/
At 01:20 PM 1/24/2002, Keith Higgs wrote:
>Great, except it doesn't work in Mozilla or Netscape 6.
Or Opera 6.
This is going to be the bane of thousands upon thousands of scripts:
if (document.layers) {
// You're Netscape 4
} else if (document.all) {
// You're IE 4+
} else {
// Too bad for you
}
These days, there really needs to be a test for the W3C DOM. I'm not an
expert, but what I copied and pasted from Those Who Know is a test for
document.getElementsByTagName("*")--excluding Netscape 4, which apparently
claims wrongly to understand this.
To the RPI page's credit, it works just fine if Javascript is disabled, or
doesn't answer to either document.layers or document.all. You just don't
get to see the rollover effect.
Thomas Dowling
OhioLINK - Ohio Library and Information Network
tdowling at ohiolink.edu
More information about the Web4lib
mailing list