go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  The source code of visibility
 
Subject: The source code of visibility
Author: WebSpider
In response to: A very good example of visibility
Posted on: 07/24/2006 07:04:12 PM

<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>


 

> On 07/24/2006 06:48:37 PM WebSpider wrote:


A very good example of visibility by using 'display' can be found in the Yahoo Sports. Click on the 'today' or 'yesterday' on the Scoreboard to see the actions.


http://sports.yahoo.com/





References:

 


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