17,230
edits
mNo edit summary |
(added "default" argument) |
||
Line 1: | Line 1: | ||
{{#vardefine:init1|hide}}{{#vardefine:init2|hidden}} | {{#ifeq: {{{default|}}} | show | ||
|{{#vardefine:init1|show}}{{#vardefine:init2|visible}}{{#vardefine:alt1|hide}}{{#vardefine:alt2|hidden}} | |||
|{{#vardefine:init1|hide}}{{#vardefine:init2|hidden}}{{#vardefine:alt1|show}}{{#vardefine:alt2|visible}} | |||
}}<!-- | |||
-->{{#switch:{{{1|}}} | -->{{#switch:{{{1|}}} | ||
| ~button = <span class="_togglegroup _toggle_init{{#var:alt1}} _toggle _toggler toggle-{{#var:alt2}}" style="display:none; {{{style|{{{showstyle|}}}}}}">{{{show|[show]}}}</span><span class="_toggle_init{{#var:init1}} _toggle _toggler toggle-{{#var:init2}}" style="display:none; {{{style|{{{hidestyle|}}}}}}">{{{hide|[hide]}}}</span> | | ~button = <span class="_togglegroup _toggle_init{{#var:alt1}} _toggle _toggler toggle-{{#var:alt2}}" style="display:none; {{{style|{{{showstyle|}}}}}}">{{{show|[show]}}}</span><span class="_toggle_init{{#var:init1}} _toggle _toggler toggle-{{#var:init2}}" style="display:none; {{{style|{{{hidestyle|}}}}}}">{{{hide|[hide]}}}</span> | ||
Line 18: | Line 20: | ||
|show= | |show= | ||
|hide= | |hide= | ||
|default= | |||
|content= | |content= | ||
}} | }} | ||
Line 23: | Line 26: | ||
{{Parameter|show|This specifies the text of the link that shows the content that is initially hidden.|Optional|[show]}} | {{Parameter|show|This specifies the text of the link that shows the content that is initially hidden.|Optional|[show]}} | ||
{{Parameter|hide|This specifies the text of the link that switches the content back to being hidden.|Optional|[hide]}} | {{Parameter|hide|This specifies the text of the link that switches the content back to being hidden.|Optional|[hide]}} | ||
{{Parameter|default|If set to ''show'', content will be displayed by default and the button will hide it.|Optional|hide}} | |||
{{Parameter|content|This specifies the content you want to be able to hide|Optional}} | {{Parameter|content|This specifies the content you want to be able to hide|Optional}} | ||
{{clear}} | {{clear}} | ||
Line 76: | Line 80: | ||
This results in: | This results in: | ||
{{Hide|show=[Unearth hidden secrets]|hide=[I'm done looking]|content=This is hidden text.}} | {{Hide|show=[Unearth hidden secrets]|hide=[I'm done looking]|content=This is hidden text.}} | ||
{{clear}} | |||
To reverse the function of the button: | |||
<div style="float:left; margin-right:20px"><pre> | |||
{{Hide|default=show|This text was already displayed. You should hide it.}} | |||
</pre></div>{{clear}} | |||
This results in: | |||
{{Hide|default=show|This text was already displayed. You should hide it.}} | |||
{{clear}} | {{clear}} | ||