View Single Post
  #2  
Old 20th February 2013, 07:58
fireknight's Avatar
fireknight fireknight is offline
Administrator
 
Join Date: Aug 2010
Australia
Posts: 173
Default
Add this to your JS files.

hideshow.js
Code:
function getObject(id)
{
      var obj = null;

      if(document.getElementById)
           obj = document.getElementById(id);
      else if(document.all)
           obj = document.all[id];
      else if(document.layers)
           obj = document.layers[id];

      return obj;
}


function toggleObject(id)
      {
      var obj = getObject(id);


      if(!obj)
           return false;

      if(obj.style.display == 'none')
      {
           obj.style.display = '';
      }

      else
      {
           obj.style.display = 'none';
      }

      return true;
}
In index.php

Add ( Change the location to suit where you keep your js files )
Code:
<script type="text/javascript" src="jsfiles/hideshow.js"></script>

Then for your index frames

Example Site Stats

Code:
<div align="center">Site Stats&nbsp;&nbsp;<a href="#" onclick="return !toggleObject('stats');">Show / Hide</a></div>
<div align="center" id="stats" style="display:none;">

Site stats code goes here

</div>
You can use this for any frame.
Just make sure that the, toggleObject name and the id name are the same.

!toggleObject('stats')
id="stats"
Reply With Quote