Click to See Complete Forum and Search --> : Browser check to hide a DIV Layer?


davidlieb
01-11-2003, 05:05 PM
Hello! I need help!

I'm a Flash designer, and am adding Flash to a HTML site. The Flash window is transparent, so it appears that things are flying over the HTML page.

Problem is that the transparent Flash only works in the following browsers:

Internet Explorer 3 or higher (Windows)
Internet Explorer 5.1* and 5.2* (Macintosh)
Netscape 7.0*
Mozilla 1.0 or higher*
AOL*
CompuServe*

So... I need a script that detects browsers and hides the DIV layer if the wrong browser is detected.

PROBLEM: I'm totally lame when it comes to scripting. Can some kind soul help me here? I'd be happy to send lots of great karma your way!

Michael Dibbets
01-12-2003, 09:40 AM
okay. getting the version of a browser

parseFloat(navigator.appVersion);

The name of a browser

navigator.appName

then you'll have to compare it

if(navigator.appName == "Netscape" && parseFloat(navigator.appVersion) > 6)
{
//hiding code
}
if(navigator.appName == "Microsoft Internet Explorer" && appVersion > 2)
{
// hiding code
}
// and this goes on and on and on

I hope this helped

davidlieb
01-12-2003, 04:02 PM
Thanks, Michael!

That's very helpful.

Would anyone happen to know the "hiding code" for a DIV layer?