Print Page | Close Window

Req: hide/show the block of text/pictures

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=27421
Printed Date: 02 April 2026 at 5:44pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Req: hide/show the block of text/pictures
Posted By: mikeak
Subject: Req: hide/show the block of text/pictures
Date Posted: 01 June 2009 at 4:41pm

Whether probably to realize an opportunity to hide/show the block of the text/pictures in post?

As it is made here:

http://www.csns.ru/Untitled_1.html" rel="nofollow - http://www.csns.ru/Untitled_1.html
 
or here:
 
http://www.csns.ru/forum/forum_posts.asp?TID=75&PID=79#79" rel="nofollow - http://www.csns.ru/forum/forum_posts.asp?TID=75&PID=79#79
(Works not correctly - for testing only: put "[SPOILER=Click here]Hidden text[/SPOILER]" in post ...)
 

The variant which has been checked up personally by me:

One piece of javascript code that I use very frequently is a function
that basically toggles the visibility of an element e.g. click, show,
click, hide.
  <script type="text/javascript">
  <!--
      function toggle_visibility(id) {
         var e = document.getElementById(id);
         if(e.style.display == 'block')
            e.style.display = 'none';
         else
            e.style.display = 'block';
      }
  //-->
  </script>

Simply paste the above snippet of code underneath your <body> tag and you call
it by passing to it the ID of the element you wish to toggle the visibility of
(this element can be anything that takes an id attribute). For example
  <a href="#" onclick="toggle_visibility('foo');">Click here to toggle visibility of element #foo</a>
  <div id="foo">This is foo</div>
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net