wtfaatp
03-02-2011, 02:31 PM
I found this BB code and im trying to get it to work with {4.1.2}
This code is for having just a spoiler
<div id="spoiler"><div><input type="button" value="Show Spoiler!" style="width:100px;font-size:12px;margin:10px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName(' div')['show'].style.display != '') { this.parentNode.parentNode.getElementsByTagName('d iv')['show'].style.display = ''; this.parentNode.parentNode.getElementsByTagName('d iv')['hide'].style.display = 'none'; this.innerText = ''; this.value = 'Hide Spoiler!'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')['show'].style.display = 'none'; this.parentNode.parentNode.getElementsByTagName('d iv')['hide'].style.display = ''; this.innerText = ''; this.value = 'Show Spoiler!'; }" /> <div id="show"; display: none; background-color:transparent; background-repeat:repeat; margin: 0px;border-style:solid;border-width:1px; padding: 4px; width:98%"> Some text</div> <div id="hide"></div></div></div>
This is for having a spoiler with text like say {[spoiler] My text here}
<div id="spoiler"><div><font size="4">Title Text</font><input type="button" value="Show Spoiler!" style="width:100px;font-size:12px;margin-left:10px;margin-bottom:3px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName(' div')['show'].style.display != '') { this.parentNode.parentNode.getElementsByTagName('d iv')['show'].style.display = ''; this.parentNode.parentNode.getElementsByTagName('d iv')['hide'].style.display = 'none'; this.innerText = ''; this.value = 'Hide Spoiler!'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')['show'].style.display = 'none'; this.parentNode.parentNode.getElementsByTagName('d iv')['hide'].style.display = ''; this.innerText = ''; this.value = 'Show Spoiler!'; }" /> <div id="show" ; display: none; background-color:transparent; background-repeat:repeat; margin: 0px;border-style:solid;border-width:1px; padding: 4px; width:98%"> Some Text</div> <div id="hide"></div></div></div>
Both codes work 'TO A POINT'.
If you use the spoiler tags the button show up ad says {Show Spoiler!}.
However it is already showing the hidden text and when you click the button it dosen't change to {Hide Spoiler!}.
Also if you use the second option the text dosen't show up on the right side. It shows up on the left side.
Anyone have any idea's?
This code is for having just a spoiler
<div id="spoiler"><div><input type="button" value="Show Spoiler!" style="width:100px;font-size:12px;margin:10px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName(' div')['show'].style.display != '') { this.parentNode.parentNode.getElementsByTagName('d iv')['show'].style.display = ''; this.parentNode.parentNode.getElementsByTagName('d iv')['hide'].style.display = 'none'; this.innerText = ''; this.value = 'Hide Spoiler!'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')['show'].style.display = 'none'; this.parentNode.parentNode.getElementsByTagName('d iv')['hide'].style.display = ''; this.innerText = ''; this.value = 'Show Spoiler!'; }" /> <div id="show"; display: none; background-color:transparent; background-repeat:repeat; margin: 0px;border-style:solid;border-width:1px; padding: 4px; width:98%"> Some text</div> <div id="hide"></div></div></div>
This is for having a spoiler with text like say {[spoiler] My text here}
<div id="spoiler"><div><font size="4">Title Text</font><input type="button" value="Show Spoiler!" style="width:100px;font-size:12px;margin-left:10px;margin-bottom:3px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName(' div')['show'].style.display != '') { this.parentNode.parentNode.getElementsByTagName('d iv')['show'].style.display = ''; this.parentNode.parentNode.getElementsByTagName('d iv')['hide'].style.display = 'none'; this.innerText = ''; this.value = 'Hide Spoiler!'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')['show'].style.display = 'none'; this.parentNode.parentNode.getElementsByTagName('d iv')['hide'].style.display = ''; this.innerText = ''; this.value = 'Show Spoiler!'; }" /> <div id="show" ; display: none; background-color:transparent; background-repeat:repeat; margin: 0px;border-style:solid;border-width:1px; padding: 4px; width:98%"> Some Text</div> <div id="hide"></div></div></div>
Both codes work 'TO A POINT'.
If you use the spoiler tags the button show up ad says {Show Spoiler!}.
However it is already showing the hidden text and when you click the button it dosen't change to {Hide Spoiler!}.
Also if you use the second option the text dosen't show up on the right side. It shows up on the left side.
Anyone have any idea's?