MyBB Central

Full Version: Spoiler mycode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Ask and you shall recieve.

Add this to your themes additional css:

Code:
a.spoiler, a.spoiler:visited, a.spoiler:active, a.spoiler:hover {color:#000; background:#fff; border: 1px dotted #ccc; text-decoration:none;}
a.spoiler span {display:none;}
a.spoiler:hover {border: 1px dotted #cccccc;}
a.spoiler:hover span {display:inline; font-weight:normal;}

Then create a new custom mycode inside admincp.

Regular Expression:
Code:
\[spoiler\](.*?)\[/spoiler\]

Replacement:
Code:
<a href="#" class="spoiler">Spoiler: <span>$1</span></a>

Change to suit your needs.  Works in IE, FF, and Opera.  

You can see it in action here:

http://www.pokemonboard.com/showthread.php?tid=150
Please let me know if you have any problems.
Here is a spoiler test:


Mirror mirror on the wall:

Test
i want to test xD
i wanna test too xD

thx labrocca, till now, i think i got all what i need here.
thanks for spending your time for these stuff.
keep up the good work
hi, can we make a show or hide button instead hover the link, because users have to hover to the spoiler content or it will disappear.
thx in advance
Pages: 1 2