Post Reply 
Spoiler Mycode
08-16-2012, 06:28 PM
Post: #1
Spoiler Mycode
Regular Expression
Code:
\[spoiler\](.*?)\[/spoiler\]

Replacement
Code:
<div>
<input type="button" value="Show Spoiler" style="width:80px;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 Spoiler'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.value = 'Show Spoiler';}">
    </div>
    <div>
        <div style="background: #ffffff;margin: 0 15px 15px 15px;padding: 5px;border: 1px solid black;display: none;">
$1
</div>
    </div>
</div>

Usage
Code:
[spoiler]Hidden text[/spoiler]

Example
Code:
[spoiler]your MyBB spoiler message here[/spoiler]
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: