Whether probably to realize an opportunity to hide/show the block of the text/pictures in post?
As it is made here:
or here:
(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> |
Edited by mikeak - 01 June 2009 at 5:43pm