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

View previous topic View next topic 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 : 22

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.forumotion.net
 
Show/Hide something
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» How do I make the login popup show an Image, instead of it's bland colors
» Design a Poster - 2011 Royal Hobart Show *australia only*
» Show Us Your Bum Photo Contest *usa only*
» Platt College Show and Tell Contest *usa only*
» Show Us Your Bling! *Read Restrictions*

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