The forum pages are fully operational! See this link for the latest forum topics, where users can collaborate or discuss certain topics in one place!
Template:Toggle
From Arthur Wiki
Revision as of 20:31, 19 August 2013 by 5000 Explosions and a Supernova (talk | contribs) (Created page with "<div class="_toggle {{{3|}}}">{{{1}}}</div><div class="_toggle {{{3|}}}" style="display:none;">{{{2}}}</div><noinclude> ==source== [http://openwetware.org/wiki/Template:Toggle...")
{{{1}}}
source[edit]
Usage[edit]
This template has to be use in parallel with toggling functions. It will only create the element that will be hidden/shown by the function
- Parameter 1 : Default content
- Parameter 2 : Replacement content (optional)
- Parameter 3 : Toggle class name
Ex : To replace a text with another by clicking on a link
{{Toggle|xxx text |yyyy text|toto}} <span class="_toggler-toto">change text</span>
xxx text
change text
When the second parameter is empty, it allows to make the text from parameter 1 disappear
{{Toggle|xxx text ||tata}} <span class="_toggler-tata">hide text</span>
xxx text
hide text
To change the content by using different link
{{Toggle|var1 xxx||var1}} <!-- var1 text will be displayed at start since it is the first parameter --> {{Toggle||var2 zzz|var2}} <!-- var2 text will be hidden at start since it is the second parameter --> <span class="_toggler_hide-var1 _toggler_show-var2">link to var2</span> <span class="_toggler_hide-var2 _toggler_show-var1">link to var1</span>
var1 xxx
link to var2 | link to var1