Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

crazynarutard

crazynarutard Avatar

*****
Senior Studio Member

1,470


August 2005
<script type='text/javascript'>
/* Hide/Show categories
Created by CrAzY_J
Open source
This copyright header must stay intact at all times.*/

var TD = document.body.getElementsByTagName('td');

var collapse = new function()
{
   this.AddLink = function()
   {
      for( t = 0 ; t < TD.length ; t ++ )
      {
         if( TD[t].className == 'catbg' && TD[t].align != 'right' && TD[t].colSpan == '5' )
         {
            TD[t].getElementsByTagName('a')[0].href = 'javascript:collapse.ShowHide("'+TD[t].getElementsByTagName('b')[0].innerHTML+'");';
            TD[t].getElementsByTagName('a')[0].appendChild( document.createTextNode( TD[t].getElementsByTagName('b')[0].innerHTML ) );
            TD[t].getElementsByTagName('b')[0].style.display = 'none';
         }
      }
   }
   this.ShowHide = function(hide)
   {
      for( t = 0 ; t < TD.length ; t ++ )
      {
         if( TD[t].className == 'catbg' && TD[t].align != 'right' && TD[t].innerHTML.match(hide) )
         {
            for( z = t+1 ; z < TD.length ; z ++ )
            {
               if( TD[z].className == 'catbg' || !TD[z].getAttribute('width') )
                  break;
               else
                  TD[z].parentNode.style.display = ( TD[z].parentNode.style.display == 'none' )? '':'none';
            }
         }
      }
   }
}
if( this.location.href.match(/\.com(\/(index\.cgi(#\w+|\?(action=home)?)?)?)?$/))
   collapse.AddLink();
</script>



Keep my copyright header comment in the code at all times.


Last Edit: Nov 30, 2005 21:48:42 GMT by crazynarutard

Jamie

Jamie Avatar

**
Official Member

62


September 2005
Nice code CJ!
Blah blah....

Currently listening: The Fray.

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Nice. :P Similar to what you did at HB if I remember correctly.

crazynarutard

crazynarutard Avatar

*****
Senior Studio Member

1,470


August 2005
cddude229 said:
Nice. :P Similar to what you did at HB if I remember correctly.

Had to edit title2 to catbg
and add a small line. :)

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Thought so. :P

newBookmarkLockedFalling