Page 1 of 1

Hide show layers with PHP?

Posted: Sat Apr 27, 2002 10:34 pm
by MattSharp
Is it possible to hide and show layers with PHP?

Posted: Sun Apr 28, 2002 12:36 am
by EvilWalrus
javascript and DHTML... php is static and server side, while javascript and dhtml is client side...

Posted: Tue Apr 30, 2002 5:02 pm
by hex

Code: Select all

<script language="javascript" type="text/javascript">
<!--

function blocking(nr) &#123;
 if (document.getElementById) &#123;
  current = (document.getElementById(nr).style.display == 'block') ? 'none' : 'block';
  document.getElementById(nr).style.display = current;
 &#125;
 else if (document.all) &#123;
  current = (document.all&#1111;nr].style.display == 'block') ? 'none' : 'block'
  document.all&#1111;nr].style.display = current;
 &#125;
 else alert ('This link does not work in your browser.');
&#125;

// -->
</script>

<div id="theLayer">This is the layer to show (or hide)</div>
<div id="layer2" style="display: none">This is a layer that starts hidden</div>

<a href="#" onClick="blocking('theLayer')">Show/Hide</a>