go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  To simply by taking care of the legacy issue document.all
 
Subject: To simply by taking care of the legacy issue document.all
Author: WebSpider
In response to: The source code of visibility
Posted on: 07/24/2006 09:47:25 PM

<script language="JavaScript">
<!--

if(!document.getElementById && document.all) {
    document.getElementById = function(id) {
         return document.all[id];
    }
}


function toShow(id)
{
  var val;
  if(document.getElementById){ // IE
    val = (document.getElementById(id).style.visibility=="hidden")?"visible":"hidden";
    document.getElementById(id).style.visibility = val;
  }else(document.layers){  // Netscape 4
    val = (document.layers[id].visibility=="hide")?"show":"hide";
    document.layers[id].visibility = val;
  }
}


function toDisplay(id)
{
  if(document.getElementById){  // IE
    val = (document.getElementById(id).style.display=="none")?"block":"none";
    document.getElementById(id).style.display = val;
  }else(document.layers){  // Netscape 4
    val = (document.layers[id].display=="none")?"block":"none";
    document.layers[id].display = val;
  }
}
// -->
</script>




 

> On 07/24/2006 07:04:12 PM WebSpider wrote:

<script language="JavaScript">
<!--
function toShow(id)
{
  var val;
  if(document.getElementById){ // IE5
    val = (document.getElementById(id).style.visibility=="hidden")?"visible":"hidden";
    document.getElementById(id).style.visibility = val;
  }else if(document.all){ // IE4
    val = (document.all[id].style.visibility=="hidden")?"visible":"hidden";
    document.all[id].style.visibility = val;
  }else(document.layers){  // Netscape 4
    val = (document.layers[id].visibility=="hide")?"show":"hide";
    document.layers[id].visibility = val;
  }
}


function toDisplay(id)
{
  if(document.getElementById){  // IE5
    val = (document.getElementById(id).style.display=="none")?"block":"none";
    document.getElementById(id).style.display = val;
  }else if(document.all){  // IE4
    val = (document.all[id].style.display=="none")?"block":"none";
    document.all[id].style.display = val;
  }else(document.layers){  // Netscape 4
    val = (document.layers[id].display=="none")?"block":"none";
    document.layers[id].display = val;
  }
}
// -->
</script>





References:

 


 
Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
 
Get your own forum today. It's easy and free.