DOM DHTML Hider

[Total: 0    Average: 0/5]

This example will hide or show a DIV.

Body Code:

<style>
.h { height: 0; color: darkblue; }
</style>
<script>
function sh(_d)
{
  var _x = document.getElementById(_d);
  _x.style.visibility=_x.style.visibility=="hidden"?"visible":"hidden";
  _x.style.overflow=_x.style.overflow=="hidden"?"visible":"hidden";
}
</script>
<div class=h id=d1>one</div>
<div class=h id=d2>two</div>
<div class=h id=d3>three</div>
<HR>
<BR>
Show/Hide: <a href="javascript:sh('d1');">ONE</a> |
<a href="javascript:sh('d2');">TWO</a> |
<a href="javascript:sh('d3');">THREE</a>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *