CODE
[spoiler=Name of spoiler]Content[/spoiler]
Which uses this code:
HTML
<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px"><strong>Spoiler</strong> - <em>{option}</em></i>: <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;">
{param}
</div>
</div>
</div>
<div class="smallfont" style="margin-bottom:2px"><strong>Spoiler</strong> - <em>{option}</em></i>: <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;">
{param}
</div>
</div>
</div>
Edit: i don't know what IPB uses {param} & {option} or $1,$2,$3 etc...
I use MYBB so i use The $1,$2,$3 etc..type but i converted it for the {param} & {option} thinking that IPB uses it....
No?
Well to use it you must put a title. An idea would be to create a second bbcode using this code:
This code will remove the need of a name for the spoiler, whilst still allowing the use of a title but not making it necessary
HTML
<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px"><strong>Spoiler</strong>:</i> <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;">
{param}
</div>
</div>
</div>
<div class="smallfont" style="margin-bottom:2px"><strong>Spoiler</strong>:</i> <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;">
{param}
</div>
</div>
</div>
Which would allow people to use a name or not:
CODE
[spoiler=name of spoiler]Content[/spoiler]
[spoiler]Content[/spoiler]
[spoiler]Content[/spoiler]
This is a feature i use on my website and is a nifty feature to the spoiler BB tag so i though it might be worth sharing with RuneCrypt.
What do you think?
