Author Topic: [Code] Spoiler  (Read 1957 times)

0 Members and 0 Guests are viewing this topic.

Offline CyanProductions

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
    • View Profile
[Code] Spoiler
« on: January 11, 2015, 12:19:52 pm »
{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 »

Share on Facebook Share on Twitter


Offline CreateAForum

  • Administrator
  • *****
  • Posts: 6204
  • Karma: 294
    • View Profile
Re: [Code] Spoiler
« Reply #1 on: January 12, 2015, 04:15:18 am »
We have one built in with the spoilder tags
Like Create A Forum? Support me at https://www.patreon.com/vbgamer45/

Offline CyanProductions

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
    • View Profile
Re: [Code] Spoiler
« Reply #2 on: January 12, 2015, 06:35:58 pm »
oh... :3
This one is still customize-able,
However, I'm sure it's possible to customize the built in spoilers.

Offline CyanProductions

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
    • View Profile
Re: [Code] Spoiler
« Reply #3 on: January 12, 2015, 06:39:09 pm »
We have one built in with the spoilder tags
Is it only possible to use in comments? This one can be used anywhere on the forum.

Offline CreateAForum

  • Administrator
  • *****
  • Posts: 6204
  • Karma: 294
    • View Profile
Re: [Code] Spoiler
« Reply #4 on: January 12, 2015, 06:54:30 pm »
Not sure. I know it works in topics.
Like Create A Forum? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
546 Views
Last post August 12, 2011, 03:02:53 am
by CB
no spoiler

Started by onbush Bugs

5 Replies
860 Views
Last post October 15, 2012, 03:51:35 pm
by onbush
4 Replies
640 Views
Last post November 20, 2013, 10:58:22 pm
by forum
2 Replies
412 Views
Last post November 09, 2015, 10:51:38 pm
by Count Bleck
11 Replies
410 Views
Last post May 17, 2020, 09:48:42 pm
by coffeegirl