![]() |
Spoiler BBCode
Hi,
I have recently migrated from vB4 to vB5 and one of my members let me know that it isn't possible anymore to preview a post and see the hidden content in our Spoiler BBCode. This is the replacement I'm using (which looks like this): Code:
<div style="padding: 3px; font-size: 1em;"><div style="text-transform: uppercase; margin-bottom: 3px; font-size: 0.8em; font-weight: bold;"><span 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.innerHTML = '<b>{option}: </b><a href=\'#\' onClick=\'return false;\'>Verberg</a>'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerHTML = '<b>{option}: </b><a href=\'#\' onClick=\'return false;\'>Toon</a>'; }" /><b>{option}: </b><a href="#" onClick="return false;">Toon</a></span></div><div class="quotecontent"><div style="display: none;">{param}</div></div></div> Thanks, Rob |
The code seems fine in most cases but if the spoiler text has single quotes in it, then the Javascript would break and would cause the "Verberg" to not show up. And if the spoiler text has double quotes in it, then it would totally break the functionality of the BBCode.
I have the same BBCode on my site and it doesn't have this issue. |
Thanks Glenn!
|
All times are GMT. The time now is 08:49 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|