469,613 Members | 2,028 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,613 developers. It's quick & easy.

need javascript to show a layer

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.
Jul 20 '05 #1
4 3017
ri********@cs.edu (Richard) writes:
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
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
lr*@hotpop.com (Lasse Reichstein Nielsen) wrote in
<u1**********@hotpop.com>:
ri********@cs.edu (Richard) writes:
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,


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

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.
Jul 20 '05 #3
ri********@cs.edu (Richard) writes:
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
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #4
Lasse Reichstein Nielsen <lr*@hotpop.com> writes:
windowless mode, including the transparent background mode, is supported by:


And Opera 7 seems to work too.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by MS newsgroup | last post: by
22 posts views Thread by the_grove_man | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.