PDA

View Full Version : BB Code Enhancements - Spoiler BB Code - jQuery Smooth Scrolling


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 &gt;&gt;</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!

intensecool
05-11-2009, 06:09 PM
<i>Demo not working</i>. Can you provide screenshots which will be helpful

1Unreal
05-11-2009, 06:33 PM
Theres nothing much to see in a screenshot.

The demo will be working shortly.

EDIT: its working now

TWTCommish
05-11-2009, 08:52 PM
I'm glad you chose to incoporate my suggestion, but why was my post about it deleted?

1Unreal
05-11-2009, 09:10 PM
I'm glad you chose to incoporate my suggestion, but why was my post about it deleted?

Did you say the bit about the display CSS attribute?

If so the last thread was deleted because there were no files. This is a re-post

Oyabun
05-13-2009, 06:10 PM
There was a spoiler before, looking just like yours. I had it on my forums.
This doesn't work without reloading, right? That is why i deleted it on my
site.

1Unreal
05-13-2009, 07:25 PM
There was a spoiler before, looking just like yours. I had it on my forums.
This doesn't work without reloading, right? That is why i deleted it on my
site.

Nope...explain what you mean

Sin City
05-22-2009, 03:05 AM
he means that when you make the post and use the spoiler mod here, you have to refresh the page in order for it to work... if you don't refresh, nothing happens when you click on it... got a fix for this, cuz if you can work out that issue, then this hack is great

Jasem
05-27-2009, 01:34 PM
thank you!