Help - Search - Members - Calendar
Full Version: Spoiler Bbcode
RuneCrypt Forum > The Crypt News > Submissions & Suggestions
Beyblade
Obviously as everyone knows to use a spoiler you must use this format:



CODE
[spoiler=Name of spoiler]Content[/spoiler]




Which uses this code:



HTML
<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px"><strong>Spoiler</strong> - <em>{option}</em></i>: <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('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[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>
</div>


Edit: i don't know what IPB uses {param} & {option} or $1,$2,$3 etc...
I use MYBB so i use The $1,$2,$3 etc..type but i converted it for the {param} & {option} thinking that IPB uses it....



No?



Well to use it you must put a title. An idea would be to create a second bbcode using this code:



This code will remove the need of a name for the spoiler, whilst still allowing the use of a title but not making it necessary



HTML
<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px"><strong>Spoiler</strong>:</i> <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('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[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>
</div>




Which would allow people to use a name or not:



CODE
[spoiler=name of spoiler]Content[/spoiler]

[spoiler]Content[/spoiler]




This is a feature i use on my website and is a nifty feature to the spoiler BB tag so i though it might be worth sharing with RuneCrypt.


What do you think?
Ironman1441
I like what we already have.
But I see no problem in adding what you have.
Trees
We have that exact same one.
Maarten
Hmm... You make a valid point.

But I don't think it's much of a problem that you have to enter a title..
Jalen
Why do that when you can just add a title? We already have our title system and it's the exact same thing.

Spoiler - LOL LOOK AT DIS TITLE:
Yah, same exact thing. -.-
Maarten
You guys don't seem to get his point, you have to name your spoiler, with his code you don't have to if you don't want to.
ddsp11
I see.

Spoiler - im guessing without the name it would be...:
[spoiler]this?


Beyblade
without the name it would be like this:

CODE
[spoiler]Content[/spoiler]


and it would format like this:

Spoiler - :
Content
ddsp11
QUOTE(Beyblade @ Mar 8 2008, 05:15 PM) *
without the name it would be like this:

CODE
[spoiler]Content[/spoiler]


and it would format like this:

Spoiler - :
Content
Dang, why must you be so much better than me in coding? dry.gif ahh well, im gonna try to work on my coding again. I hardly remember my HTML
Otter
Way to revive an old topic for no reason thumbsup.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.