![]() |
[BB Code] Sliding Spoiler with jQuery
1 Attachment(s)
What does this mod do?
This is a normal spoiler, with which you can hide some text in your post. When a user clicks on the spoiler name, a field will slide in/out with the hidden text. Where is it useful? This could be useful for serveral things, of couse it is not as mighty as a real hide hack, but you could hide small / unimportant information such as an answer for an rethoric question or you could hide some offtopic spam in a context post. How does it looks? Closed spoiler: https://vborg.vbsupport.ru/attachmen...1&d=1272073026 Open Spoiler: https://vborg.vbsupport.ru/attachmen...1&d=1272073026 How to install? 1. Upload the picture https://vborg.vbsupport.ru/attachmen...1&d=1272075022 into the following directory via ftp: [forum_root]/images/icons/ 2. Upload the Editor Icon via ftp: https://vborg.vbsupport.ru/attachmen...1&d=1272074407 into [forum_root]/images/editor/ Uploads are finished now! 3. Create a new BBCode via ACP with the following settings: Title: Spoiler BB-Code Tag: sp Code: Code:
<div class="spoilerBB"> Example: [sp]Hidden text![/sp] Description: This code hides/show a text within the spoiler tag {option} usage: NO! Image: /images/icons/spoiler.gif You can check the rest however you like, but I was using: Remove Tag: Yes and the rest: No Now you can save. 3. jQuery Part: If you are already using jquery on your website you can easily skip part3 and go on to part4. However, if you dont have jquery implented you can do this just like that: Open your ACP -> Styles & Templates -> "Configure Styles" -> choose "Alter Templates" -> click on the template "footer" and than "edit" Scroll down to the very last code line where something should be written like this: Code:
{vb:raw ad_location.ad_footer_end} Code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> 4. Your Spoiler hack should already work! On the other hand it looks pretty "blank" So lets do some quick n dirty CSS (3): In my case I created an extra external stylesheet for my board, in many cases thats not the case, I am actually not that deep into vbulletin yet with all the style vars and so on but what we need is this little css: Code:
/*SPOILER*/ Above: Code:
<style type="text/css"> Code:
</style> 5. Thats it - you are done All the best bpr |
Excellent Tagged
|
Will test :D
|
this is just what i needed and it actually works as it should! THANKS!
|
there is one bug though; using widgets with last posts and if the spoiler is somewhere on the beginning of the post, the widget reveals it.
|
All times are GMT. The time now is 06:56 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|