NuclearBlast Forums

The end is near...
 
HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
Search
 
 

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

» Shaman King Master of Spirits 2
Sun Nov 02, 2008 10:16 am by AkmaYo

» :O!!!!!1!!!!!!!!!!!!!!!!1
Sat Oct 25, 2008 12:25 pm by Spork

» Edit a page (for fun, not real)
Wed Aug 27, 2008 4:29 pm by AkmaYo

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

» Main Rules
Wed Aug 27, 2008 9:21 am by AkmaYo

» READ THE FORUM RULES!!!
Wed Aug 27, 2008 8:44 am by AkmaYo

Forum
Affiliates
free forum
 

Share | 
 

 Show/Hide something

Go down 
AuthorMessage
Yuxuan



Posts : 1
Join date : 2008-08-27

PostSubject: Show/Hide something   Wed 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
View user profile
AkmaYo
Admin
avatar

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

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

Cool, also, nice code!

_________________
I'm AkmaYo, got a problem with me?
Back to top Go down
View user profile http://nuclearblast.board-directory.net
 
Show/Hide something
Back to top 
Page 1 of 1
 Similar topics
-
» Show/Hide Members Profile fields [For All Version]
» How do I make the login popup show an Image, instead of it's bland colors
» Show Us Your Bling! *Read Restrictions*
» Is there a way to hide my css?
» 9th Makassar Koi Show

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