need javascript to show a layer

R

Richard

Can someone help me figure out how to show a hidden layer *ONLY* if the
browser is IE for windows? I want it to remain hidden for everything else,
Netscape, Opera, Mozilla and anything for Mac. I'm not having much luck
out here.

Thank you.
 
L

Lasse Reichstein Nielsen

Can someone help me figure out how to show a hidden layer *ONLY* if the
browser is IE for windows? I want it to remain hidden for everything else,
Netscape, Opera, Mozilla and anything for Mac. I'm not having much luck
out here.

While I can't help to wonder why you would want that, here are some
suggestions.

Since you only care about IE, you might only care about some IE versions.
In IE 5 and later, you can use conditional comments:
<!--[if IE]>
<div id='hidden'>
...
</div>
<![endif]-->
All other browsers will only see HTML-comments. (I don't *think* IE 5.2/Mac
will understand conditional comments).
<URL:http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/ccomment_ovw.asp>

Otherwise, you must find a way to uniquely identify IE/Win. It has
been discussed before, and the conclusion was that object detection is
not a safe way to detect IE. Other browsers emulate IE in any way they
can, including lying about their name in navigator.appName etc. If you
find a feature that distinguishes IE from other browsers, chances are
another browser will emulate that feature sooner or later.

So far, no browser have implemented conditional comments. Maybe one
will eventually. It is what I would use, and not care about IE4.

/L
 
R

Richard

(e-mail address removed) (Lasse Reichstein Nielsen) wrote in
While I can't help to wonder why you would want that,

Because the layer contains a flash movie which MUST play in transparent
mode, which is only supported in IE for windows. Ok?


here are some
suggestions.

Since you only care about IE, you might only care about some IE
versions. In IE 5 and later, you can use conditional comments:
<!--[if IE]>
<div id='hidden'>
...
</div>
<![endif]-->

That works perfectly. Thank you.
 
L

Lasse Reichstein Nielsen

Because the layer contains a flash movie which MUST play in transparent
mode, which is only supported in IE for windows. Ok?

Transparent mode, that is the same as windowless mode with transparent
background, set with the wmode parameter of the embed tag, right?

According to
<URL:http://www.macromedia.com/support/flash/releasenotes/player/rn_6.html>
windowless mode, including the transparent background mode, is supported by:
Windows Internet Explorer
Windows Netscape 7.0
Windows AOL
Windows Mozilla 1.0
Mac OS X IE 5.1
Mac OS X IE 5.2
Mac OS X Netscape 7.0
Mac OS X AOL
Mac OS X Mozilla 1.0
Mac OS X CompuServe
See also <URL:http://www.macromedia.com/support/flash/ts/documents/wmode.htm>
for which version of Flash is needed for each browser.

/L
 
L

Lasse Reichstein Nielsen

Lasse Reichstein Nielsen said:
windowless mode, including the transparent background mode, is supported by:

And Opera 7 seems to work too.

/L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,093
Messages
2,570,607
Members
47,227
Latest member
bluerose1

Latest Threads

Top