PDA

View Full Version : Spoiler Tag: Visibility


Oblivion Knight
03-30-2005, 04:50 PM
I'm trying to make a spoiler tag similar to one that I used back in the UBB days.. I've succeeded to an extent, but maybe someone will be able to help me.

This is my Replacement HTML:
<div style="margin:20px; margin-top:5px; ">
<table width="100%" border="0" align="center" cellpadding="6" cellspacing="0">
<tr>
<td><fieldset><legend>spoiler (<a href="#" onclick="spoiler.className='showspoiler'; return false;" ondblclick="spoiler.className='spoiler'; return false;">click to view</a>)</legend><span id="spoiler" class="spoiler">Spoiler example..</span></fieldset></td>
</tr>
</table>
</div>The css attributes have been defined under "Additional CSS Definitions" as:
.spoiler { visibility: hidden; }
.showspoiler { visibility: visible; }This works almost as intended with Internet Explorer, though it doesn't work at all with Firefox..

Ideally, I'd like to click the link once to display the spoiler and then once again to hide it. The main issue that I'm having with Internet Explorer is when more than one post on a page uses the spoiler tag, it then ceases to function.. I imagine that I'd have to use some kind of $post[postid] variable with it? Firefox just never displays the spoiler in the first place after clicking the link..

sabret00the
03-30-2005, 05:03 PM
i released one of bf2 that may help

Oblivion Knight
03-30-2005, 06:06 PM
Cheers for the heads up..

Just viewed a demo with someone using your code and it worked perfectly in both browsers, so I'll have another crack at it tonight. It shouldn't be too hard to replace the button with a link instead.. :)