...

View Full Version : Show/hide layer depending on browser



underlircs
03-23-2005, 11:44 PM
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>

underlircs
03-24-2005, 12:19 AM
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>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum