Skip to content

[Code] Spoiler

3328 Views 4 Replies

0 Members and 1 Guest are viewing this topic.

[Code] Spoiler
on:
#1
{Code}: Spoiler



Description:
Show/Hide objects(text, image, etc..)


This code utilizes jQuery, please use the latest version found in this thread: http://support.createaforum.com/5/jquery-v1-8-update/

Footers:

Quote
<script>
$("[class*='show_text']").hide();
var show_count = 0; $( ".show_" ).click(function() {   show_count = $(this).attr("id");   if ($("#" + show_count + ".show_text").is(":hidden")) {     $("#" + show_count + ".show_text").show();     $("#" + show_count + ".show_hint").hide();     $(this).text("Hide")   } else {     $("#" + show_count + ".show_text").hide();     $("#" + show_count + ".show_hint").show();     $(this).text("Show")   } });
</script>



Setup: Create html buttons: <button id="0" class="show_">Show</button> | Create spoiler hint: <p id="0" class="show_hint">(this is a spoiler)</p> | Create text that hides and shows: <p id="0" class="show_text">This is Text</p>

Editing: If you would like to add more than 1 spoiler, simply copy and paste the button and text. Change the 0 to {1,2,3,4,5,6,7, etc...}



Example:
[Show](this is a spoiler)


[Hide] This is text




- Cyan
Last Edit: January 11, 2015, 07:00:14 pm by CyanProductions
Re: [Code] Spoiler
Reply #2 on:
#3
oh... :3
This one is still customize-able,
However, I'm sure it's possible to customize the built in spoilers.
 

Related Topics