need javascript to show a layer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard

    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.
  • Lasse Reichstein Nielsen

    #2
    Re: need javascript to show a layer

    richard555@cs.e du (Richard) writes:
    [color=blue]
    > 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.[/color]

    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.as p>

    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.appNa me 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 - lrn@hotpop.com
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • Richard

      #3
      Re: need javascript to show a layer

      lrn@hotpop.com (Lasse Reichstein Nielsen) wrote in
      <u178it63.fsf@h otpop.com>:
      [color=blue]
      >richard555@cs. edu (Richard) writes:
      >[color=green]
      >> 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.[/color]
      >
      >While I can't help to wonder why you would want that,[/color]

      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[color=blue]
      >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]-->[/color]

      That works perfectly. Thank you.

      Comment

      • Lasse Reichstein Nielsen

        #4
        Re: need javascript to show a layer

        richard555@cs.e du (Richard) writes:
        [color=blue]
        > Because the layer contains a flash movie which MUST play in transparent
        > mode, which is only supported in IE for windows. Ok?[/color]

        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 - lrn@hotpop.com
        Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
        'Faith without judgement merely degrades the spirit divine.'

        Comment

        • Lasse Reichstein Nielsen

          #5
          Re: need javascript to show a layer

          Lasse Reichstein Nielsen <lrn@hotpop.com > writes:
          [color=blue]
          > windowless mode, including the transparent background mode, is supported by:[/color]

          And Opera 7 seems to work too.

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

          Comment

          Working...