vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Spoiler Tag: Visibility (https://vborg.vbsupport.ru/showthread.php?t=79077)

Oblivion Knight 03-30-2005 04:50 PM

Spoiler Tag: Visibility
 
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:
HTML Code:

<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:
HTML Code:

.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.. :)


All times are GMT. The time now is 09:25 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
  • Page Generation 0.01059 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete