PDA

View Full Version : BB Code Enhancements - Classic button Spoiler


Fatal Hazard
03 Mar 2013, 17:37
This BB Code allows you to show/hide text

Title: Spoiler
BB Code Tag Name: Spoiler
Replacement:
<div style="margin: 5px 20px 20px;"> <div class="smallfont" style="margin-bottom: 2px;"><b>Spoiler:</b>&nbsp; <input value="Show" style="margin: 0px; padding: 0px; width: 45px; font-size: 10px;" 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'; }" type="button" /> </div> <div class="alt2" style="border: 1px inset ; margin: 0px; padding: 6px;"> <div style="display: none;"> {param} </div> </div> </div>

Example: Some Text
Description: Allows you to hide/show text.

Remove Tag If Empty
Yes

Disable BB Code Within This BB Code
No

Disable Smilies Within This BB Code
No

Disable Word Wrapping Within This BB Code
No

Disable Automatic Link Parsing Within This BB Code
No

If you wish to allow users to have spoilers inside on spoilers then set 'Remove Tag If Empty' to NO. Otherwise leave it as it is.

I will be releasing bigger add ons for vB5 in it's later releases.

ndut
11 Jan 2014, 02:33
thank you

matheus21
17 Oct 2014, 16:32
'm new to vbulletin where I lap this code,? version 5.1.3
tanck