Here's an alternate solution using vbulletin's system and some CSS:
1. Set up a new bbcode tag. Make [spoiler] the tag, and make the code:
Code:
<strong>SPOILERS: </strong>Mouseover to view.<br /><div id="spoiler">{param}</div>
2. Add the following lines to this board's template's CSS file:
Code:
#spoiler {
border-color:#999999;
border:solid 1px;
padding:5px;
text-align:left;
font-family:verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
font-size:10px;
color:#FFFFFF;
background-color:#FFFFFF;
margin-top:0;
width:90%;
}
#spoiler:hover {
color:#0099CC;
}
This will create a white box with the spoiler text in it also in white (so invisible). When the mouse goes over the spoiler box, the text will turn grey so you can read it. This is nice, clean CSS with no script or processing required.
This is the javascript code I use for an actual spoiler button that hides the div entirely and then shows it when you click, and rehides when you click again. I'm not sure, but I think this might work as is if you added it as a custom bbcode button (I already replaced the tag used in phpBB with {param}, which is used by the vbulletin system in bbcodes. Maybe give this a shot as is and test it out, then if it works, modify the colors to match the board here?
Code:
<div class="smallfont" style="margin-bottom:2px"><b>Spoiler:</b> <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><p><div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset; background-color: #FAFAFA; border: #D1D7DC; border-style: solid; border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px"><div style="display: none;">{param}</div></p></div></div></span></td></tr></table></span>