effgee
01-26-2007, 06:26 AM
Hi all!
I would like to create a custom bbCode tag [spoiler] that can be collapsed/expanded via JS. In order to be able to do that however, I need to assign unique IDs to each container displaying a spoiler posted by users.
So I was wondering if it was possible to create a custom bbCode tag [spoiler], where the replacement code contains the variable $postid, similar to the snippet below:
<div id="spC_$postid" onclick="JSgoeshere">
<div class="spBody"> (This just for formatting)
{param}
</div>
</div>
("spC_" = prefix so the div doesn't have the same ID as the postbit container)
Any hints/tips/pointers would be greatly appreciated.
:)
I would like to create a custom bbCode tag [spoiler] that can be collapsed/expanded via JS. In order to be able to do that however, I need to assign unique IDs to each container displaying a spoiler posted by users.
So I was wondering if it was possible to create a custom bbCode tag [spoiler], where the replacement code contains the variable $postid, similar to the snippet below:
<div id="spC_$postid" onclick="JSgoeshere">
<div class="spBody"> (This just for formatting)
{param}
</div>
</div>
("spC_" = prefix so the div doesn't have the same ID as the postbit container)
Any hints/tips/pointers would be greatly appreciated.
:)