DIR Return Create A Forum - Home
---------------------------------------------------------
Create A Forum - Support Forums
HTML https://support.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: Create a Forum Codes and Support
*****************************************************
#Post#: 15066--------------------------------------------------
[Code] Spoiler
By: CyanProductions Date: January 11, 2015, 6:19 am
---------------------------------------------------------
{Code}: Spoiler
[hr]
[font=verdana]
Description: Show/Hide objects(text, image, etc..)[/font]
[font=verdana]This code utilizes jQuery, please use the latest
version found in this thread:
HTML http://support.createaforum.com/5/jquery-v1-8-update/
HTML http://support.createaforum.com/5/jquery-v1-8-update/[/font]
[font=verdana]Footers:[/font]
[quote][font=verdana]<script>
$("[class*='show_text']").hide();[/font][font=verdana] var
show_count = 0;[/font] [font=verdana]$( ".show_"
).click(function() {[/font] [font=verdana] show_count =
$(this).attr("id");[/font] [font=verdana] if ($("#" +
show_count + ".show_text").is(":hidden")) {[/font]
[font=verdana] $("#" + show_count +
".show_text").show();[/font] [font=verdana] $("#" +
show_count + ".show_hint").hide();[/font] [font=verdana]
$(this).text("Hide")[/font] [font=verdana] } else {[/font]
[font=verdana] $("#" + show_count +
".show_text").hide();[/font] [font=verdana] $("#" +
show_count + ".show_hint").show();[/font] [font=verdana]
$(this).text("Show")[/font] [font=verdana] }[/font]
[font=verdana]});[/font]
</script>[/quote]
Setup: Create html buttons: <button id="0"
class="show_">Show</button> [font=verdana]|[/font][font=verdana]
Create spoiler hint: <p
id="[/font][font=verdana]0[/font][font=verdana]"
class="show_hint">(this is a spoiler)</p>
[/font][font=verdana]|[/font][font=verdana] Create text that
hides and shows: <p
id="[/font][font=verdana]0[/font][font=verdana]"
class="show_text">This is Text</p>[/font]
[font=verdana]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...}[/font]
[hr]
Example:
[Show](this is a spoiler)
[font=verdana][[/font][font=verdana]Hide[/font][font=verdana]]
[/font][font=verdana]This is text[/font]
[hr]
[font=verdana] - Cyan[/font]
#Post#: 15074--------------------------------------------------
Re: [Code] Spoiler
By: CreateAForum Date: January 11, 2015, 10:15 pm
---------------------------------------------------------
We have one built in with the spoilder tags
#Post#: 15084--------------------------------------------------
Re: [Code] Spoiler
By: CyanProductions Date: January 12, 2015, 12:35 pm
---------------------------------------------------------
oh... :3
This one is still customize-able,
However, I'm sure it's possible to customize the built in
spoilers.
#Post#: 15085--------------------------------------------------
Re: [Code] Spoiler
By: CyanProductions Date: January 12, 2015, 12:39 pm
---------------------------------------------------------
[quote author=CreateAForum link=topic=4110.msg15074#msg15074
date=1421036118]
We have one built in with the spoilder tags
[/quote]
Is it only possible to use in comments? This one can be used
anywhere on the forum.
#Post#: 15086--------------------------------------------------
Re: [Code] Spoiler
By: CreateAForum Date: January 12, 2015, 12:54 pm
---------------------------------------------------------
Not sure. I know it works in topics.
*****************************************************