PDA

View Full Version : HTML help, clash with vBulletin BBCODE


grOOvy
03-03-2005, 06:16 AM
Hello!

I use custom bbcode on my forum for 'spoilers'. The code for this custom bbcode replacement is:


<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('d iv')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')[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>

This works fine and dandy if there is only one spoiler tag in a particular post. However if the post also contains a quote tag or an additional spoiler tag, only the first spoiler tag works and the rest don't do anything upon clicking on the "Show" button. Any reason why? I am using vBulletin version 3.0.7.

Thank you for the help in advance.

Zachery
03-03-2005, 01:32 PM
Hello!

I use custom bbcode on my forum for 'spoilers'. The code for this custom bbcode replacement is:


<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('d iv')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')[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>

This works fine and dandy if there is only one spoiler tag in a particular post. However if the post also contains a quote tag or an additional spoiler tag, only the first spoiler tag works and the rest don't do anything upon clicking on the "Show" button. Any reason why? I am using vBulletin version 3.0.7.

Thank you for the help in advance.
Looks like you have conflicting js...