MyBB Community Forums

Full Version: Spoiler Tags with Title
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Regular Expression:
\[spoiler=(.*?)\](.*?)\[/spoiler\]

Replacement:
<tag><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: $1 <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }">
</div>
<div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;">
<div style="display: none;">
$2
</div>
</div>
</div>
</tag>

Just do something like this:

[spoiler=Information from the new CoroCoro Magazine]
Information Here
[/spoiler]
CoroCoro Big Grin

This is neat, thanks!
Cool. Thank you (:
Testing....
doesn't work :/, if someone could fix it. it would be awesome!
It works for me. Are you sure you pasted the right code?
my fault, used the code wrong to post with.
Could you add some screenshot/preview? Thanks.
Works...
Very nice code :D
Pages: 1 2