473,320 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 3094
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: mscir | last post by:
I was calling a function in a js file from an image onClick event, but someone still using Netscape 4 (!) complained that it didn't work. I read that img onClick doesn't work in Netscape 4, so...
2
by: l!m!t | last post by:
Hello, I hope somebody can help me I have been at this for hours. I am new to JavaScript. I need a script to show a layer of hidden content only when on a certain URL. I have searched and...
16
by: MS newsgroup | last post by:
I don't have clear reasons why we need business logic layer and data logic layer instead of having only data logic layer. Are there any good reasons for that?
22
by: the_grove_man | last post by:
I purchased a book titled "Pro ASP.NET 2.0" to get up to speed on web stuff because I ususally do Windows Form Applications.. But in the first chapters I was reading this week it brought to mind...
3
by: Jim | last post by:
How can I use Javascript to show a layer named "callout" after the page has been delayed for 5 seconds? Using the onLoad behavior to execute a "Call Javascript" action. What is the correct...
1
by: saravanatmm | last post by:
I need javascript code for validate the email address. Email address field cannot allowed the capital letters, special characters except '@' symbol. But can allowed the small letters, numeric...
10
by: Dutchmarshalls | last post by:
Hi All, I'm using a Pay Pal form script, but locally tested in Dreamweaver with a browser it will do exactly what I'm aspect it to do. Only when I'm uploaded the file on the server it will give...
1
by: swetha123 | last post by:
hello, Can any one please tell me I am Using php,Mysql,CSS to build my site In my database i have small images and large images i am show the small images to the right of the main container...
3
by: swetha123 | last post by:
hello, Can any one please tell me I am Using php,Mysql,CSS to build my site In my database i have small images and large images i am show the small images to the right of the main container...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.