NuclearBlast Forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

NuclearBlast Forums

The end is near...
 
HomePortalLatest imagesSearchRegisterLog in
Search
 
 

Display results as :
 
Rechercher Advanced Search
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Latest topics
» 1st topic hooray
Show/Hide something Icon_minitimeSat Nov 29, 2008 3:38 pm by Bzilla

» Shaman King Master of Spirits 2
Show/Hide something Icon_minitimeSun Nov 02, 2008 10:16 am by AkmaYo

» :O!!!!!1!!!!!!!!!!!!!!!!1
Show/Hide something Icon_minitimeSat Oct 25, 2008 12:25 pm by Spork

» Edit a page (for fun, not real)
Show/Hide something Icon_minitimeWed Aug 27, 2008 4:29 pm by AkmaYo

» Show/Hide something
Show/Hide something Icon_minitimeWed Aug 27, 2008 4:26 pm by AkmaYo

» Main Rules
Show/Hide something Icon_minitimeWed Aug 27, 2008 9:21 am by AkmaYo

» READ THE FORUM RULES!!!
Show/Hide something Icon_minitimeWed Aug 27, 2008 8:44 am by AkmaYo

Forum
Affiliates
free forum
 

 

 Show/Hide something

Go down 
2 posters
AuthorMessage
Yuxuan




Posts : 1
Join date : 2008-08-27

Show/Hide something Empty
PostSubject: Show/Hide something   Show/Hide something Icon_minitimeWed Aug 27, 2008 4:20 pm

Place this in the header:
Code:
<script type="text/javascript">function show_hide(the_layer)
{
  if(document.getElementById(the_layer))
  {
    if(document.getElementById(the_layer).style.display == 'none')
    {
      document.getElementById(the_layer).style.display = 'inline';
    }
    else
    {
      document.getElementById(the_layer).style.display = 'none';
    }
  }
}</script>

And add this:
Code:
<a href="javascript:show_hide('showhidestuff');">Hide/Show</a>
Then you have to create a div or something with the id of showhidestuff, like a table or a span or something.

Ex. of code for webpage:
Code:
<html><head><script type="text/javascript">function show_hide(the_layer)
{
  if(document.getElementById(the_layer))
  {
    if(document.getElementById(the_layer).style.display == 'none')
    {
      document.getElementById(the_layer).style.display = 'inline';
    }
    else
    {
      document.getElementById(the_layer).style.display = 'none';
    }
  }
}</script></head><body><table id="showhidestuff"><tr><td>Stuff that's going to be shown/hidden</td></tr></table><br><a href="javascript:show_hide('showhidestuff');">Hide/Show</a></body></html>
Back to top Go down
AkmaYo
Admin
AkmaYo


Posts : 5
Join date : 2008-08-27
Age : 29

Show/Hide something Empty
PostSubject: Re: Show/Hide something   Show/Hide something Icon_minitimeWed Aug 27, 2008 4:26 pm

Cool, also, nice code!
Back to top Go down
https://nuclearblast.board-directory.net
 
Show/Hide something
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
NuclearBlast Forums :: Resources :: Code Snippets-
Jump to: