[BBCode] jQuery Spoiler
Posted: 12 Dec 2011, 10:40
Title: jQuery Spoiler
Description: Spoiler for long descriptions
Autor: liptonace [minor changes by FTH & all4phone]
BBCode usage:
HTML replacement:
Helpline:
Example:
necessary edits:
Open: styles/your_style/template/overall_header.html
Find:
Before add:
NOTE: This spoiler uses the jQuery library. It is your responsibility to ensure adding this BBCode does not cause any conflicts with other jQuery related BBCodes/MODs on your board. jQuery should never be included on a page more than once.
Demo:
http://youtu.be/8mS1STsRBhM
Description: Spoiler for long descriptions
Autor: liptonace [minor changes by FTH & all4phone]
BBCode usage:
Code: Select all
[spoiler]{TEXT}[/spoiler]
Code: Select all
<div style="margin:5px; margin-top:5px; border: 1px solid #3bbfe7;" class="codebox">
<div style="height:22px; text-align: center;"><strong>PhpBB3BBCodes Spoiler:</strong>
<input type="button" class="changevalue" value="{L_EXPAND_VIEW}" style="width:100px; font-size:10px; margin:0px; padding:0px;" onclick="$(this).parents('.codebox').find('.content').toggle('slow');"></div>
<div class="content" style="display: none; background-color:#e6e6e6; padding: 5px;">{TEXT}</div></div>
Code: Select all
Spoiler for long descriptions: [spoiler]text[/spoiler]
Code: Select all
[spoiler]hidden text :) :D[/spoiler]
necessary edits:
Open: styles/your_style/template/overall_header.html
Find:
Code: Select all
</head>
Code: Select all
<script type="text/javascript">
// <![CDATA[
!window.jQuery && document.write('<script type="text\/javascript" src="http:\/\/code.jquery.com\/jquery-latest.min.js"><\/script>');
// ]]>
</script>
<script type="text/javascript">
$("document").ready(
function()
{
$("input.changevalue").toggle(
function()
{
$(this).val('{L_COLLAPSE_VIEW}');
},
function()
{
$(this).val('{L_EXPAND_VIEW}');
}
);
}
);
</script>
Demo:
http://youtu.be/8mS1STsRBhM