Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Show/hide layer depending on browser

    Hi, I'm very new at Javascripting and I've been search google for the past few hours and I haven't been able to find what I'm looking for so any help would be greatly appreciated.

    I'm trying to show and hide a layer inside the page depending on the user's browser. I already have a javascript browser sniffer in place that works but I've been trying to figure how to get it to show/hide layers inside that code.

    [CODE]
    <script language="JavaScript1.2" type="text/javascript">
    if (is_ie || is_safari && is_mac || is_win)
    {
    window.location="http://www.google.com";
    }
    else {
    document.(qtControls).visibility="visible";
    }
    </script>

  • #2
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    For the future incase someone else is also looking for it, this works.

    [CODE]
    <script language="JavaScript1.2" type="text/javascript">
    if (is_ie || is_safari && is_mac || is_win)
    {
    window.location="http://www.google.com";
    }
    else {
    alert ("QT Controls Will Work");
    document.getElementById("qtControls").style.visibility = "visible"; // or “hidden”
    }
    </script>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •