Template:Spoilers: Difference between revisions
(rm newlines) Tag: 2017 source edit |
No edit summary |
||
Line 1: | Line 1: | ||
<div class="spoilerblur">{{{1|{{{text|some spoilered text}}}}}}</div><noinclude>{{documentation}}</noinclude> |
|||
<span class="mw-customtoggle-{{#vardefineecho:spoilerid|{{#expr:{{#var:spoilerid}}+1}}}}" style="position: relative; background:#00000030; display: inline-block">{{{1|{{{text|some spoilered text}}}}}}<div class="mw-collapsible mw-customtoggle-{{#var:spoilerid}}'" id="mw-customcollapsible-{{#var:spoilerid}}" style="position: absolute; display: inline-block; top: 0; left: 0; height: 100%; width: 100%; background: black; color: gray; overflow: hidden">{{{2|{{{spoilertext|}}}}}}</div></span><noinclude>{{documentation}}</noinclude> |
Revision as of 19:02, 14 April 2022
Puts text into a clickable-to-reveal spoiler.
Usage
{{spoiler | text = [Optional] Inline text. If omitted, a block spoiler will be created (and should be ended with {{spoiler-end}}.) | label = [Optional] Spoiler label. Default is "Click to reveal" | label-hide = [Optional] Spoiler hide label (for block level spoilers only). Default is "Click to hide" | class = [Optional] CSS class to use for styles. Default is "default" }}
Examples
This is an Click to revealinline spoiler.
Puts small amounts of text into a clickable-to-reveal spoiler. Takes two parameters, text
(what will be revealed on click) and spoilertext
(a label; the latter is optional. You can also simply use them as the first and second parameter (unless the text has a =
, for technical reasons), as shown:
{{spoiler}}
THIS IS A BLOCK CONTENT SPOILER.
THIS IS MORE CONTENT
{{spoiler-end}}
gives
THIS IS A BLOCK CONTENT SPOILER.
THIS IS MORE CONTENT
{{spoiler|label=This is a multi-nested spoiler}}
THIS IS A BLOCK CONTENT SPOILER.
THIS IS MORE CONTENT
{{spoiler}}
THIS IS A NESTED BLOCK LEVEL SPOILER
{{spoiler-end}}
THIS IS A {{spoiler|text=NESTED INLINE SPOILER}}.
{{spoiler-end}}
THIS IS A BLOCK CONTENT SPOILER.
THIS IS MORE CONTENT
THIS IS A NESTED BLOCK LEVEL SPOILER
THIS IS A Click to revealNESTED INLINE SPOILER.