1Unreal
05-10-2009, 10:00 PM
Ive not seen a very pretty spoiler BB code so I thought I would make one. It uses some really simple jQuery code so its very easy to modify with some other cool effects https://vborg.vbsupport.ru/external/2011/01/23.gif
Heres a demo
(http://www.theflickzone.com/tutorials/846-spoiler-bb-code.html#post1561)
How to install
Open up the admin CP and go to the BB Code manager.
Add a new BB code and add all the settings you think are appropriate.
For the HTML replacement use the following code:
<p><span class="spoiler">{param}</span></p>
Then open up your style manager and go to headinclude and add the following code:
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("span.spoiler").hide();
$('<a class="reveal">Reveal Spoiler >></a> ').insertBefore('.spoiler');
$("a.reveal").click(function(){
$(this).parents("p").children("span.spoiler").fadeIn(2500);
$(this).parents("p").children("a.reveal").fadeOut(600);
});
});
</script>
Then youre done!
Heres a demo
(http://www.theflickzone.com/tutorials/846-spoiler-bb-code.html#post1561)
How to install
Open up the admin CP and go to the BB Code manager.
Add a new BB code and add all the settings you think are appropriate.
For the HTML replacement use the following code:
<p><span class="spoiler">{param}</span></p>
Then open up your style manager and go to headinclude and add the following code:
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("span.spoiler").hide();
$('<a class="reveal">Reveal Spoiler >></a> ').insertBefore('.spoiler');
$("a.reveal").click(function(){
$(this).parents("p").children("span.spoiler").fadeIn(2500);
$(this).parents("p").children("a.reveal").fadeOut(600);
});
});
</script>
Then youre done!