Template:Spoiler: Difference between revisions

From Step Mods | Change The Game
No edit summary
No edit summary
Line 1: Line 1:
<includeonly><div class="mw-collapsible mw-collapsed"><div class="mw-collapsible-toggle" style="float:none; cursor:pointer; color:#8DA9C0; display:inline-block;">{{{1}}}</div><div class="mw-collapsible-content">{{{2}}}</div></div></includeonly><noinclude>__NOTOC__
<includeonly><div class="mw-collapsible mw-collapsed"><div class="mw-collapsible-toggle" style="float:none; cursor:pointer; color:#8DA9C0; display:inline-block;">{{{shown}}}</div><div class="mw-collapsible-content">{{{hidden}}}</div></div></includeonly><noinclude>__NOTOC__


==Purpose & Usage==
==Purpose & Usage==
Line 5: Line 5:


===Parameters===
===Parameters===
*''parameter 1'' is the text clicked to show the hidden content
*''parameter shown'' is the text clicked to show the hidden content
*''parameter 2'' is the hidden content
*''parameter hidden'' is the hidden content
*''parameter width'' is the width of the text to be clicked. This should be the amount necessary to fit the text on one line. Using the <code>ch</code> increment is easiest, as it is approximately the width of one character, although it is incompatible with older browsers (compatible with all up-to-date modern browsers).


==Examples==
==Examples==
'''Code:'''
'''Code:'''
<pre>{{Spoiler|Click Me!|Where did this come from?}}</pre>
<pre>{{Spoiler|shown=Click Me!|hidden=Where did this come from?}}</pre>


'''Result:'''
'''Result:'''
{{Spoiler|Click Me!|Where did this come from?}}
{{Spoiler|shown=Click Me!|hidden=Where did this come from?}}
 
'''Code:'''
<pre>{{Spoiler|Click Me!|width=7ch|Where did this come from?}}</pre>
 
'''Result:'''
{{Spoiler|Click Me!|width=7ch|Where did this come from?}}


== Known Issues ==
== Known Issues ==

Revision as of 01:39, May 7, 2015


Purpose & Usage

This template allows text to be clicked like a spoiler to show hidden text immediately underneath it.

Parameters

  • parameter shown is the text clicked to show the hidden content
  • parameter hidden is the hidden content

Examples

Code:

{{Spoiler|shown=Click Me!|hidden=Where did this come from?}}

Result:

Click Me!
Where did this come from?

Known Issues

  • Incompatible with CSS extension
  • The entire line for the text to click to reveal the text will be clickable instead of only the text. This can be alleviated by specifying the width with the width=<value> parameter, where <value> is the correct width for your phrase.

See Also

No similar templates known.