OpenWetWare:Toggle: Difference between revisions
From OpenWetWare
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
This feature allows for toggling the visibility of any part of the page. | This feature allows for toggling the visibility of any part of the page. | ||
==Fun Examples== | ==Fun Examples== | ||
Probably the best way to learn how the toggle code works is to look at some examples (and be sure to look at the source of this page). | |||
===Simple hiding=== | ===Simple hiding=== | ||
{{hide|hello world}} | {{hide|hello world}} | ||
Line 17: | Line 19: | ||
{{show hide all}} | {{show hide all}} | ||
===Mutual toggling=== | |||
# <span class="_toggler-toggler2 toggler1">Toggle #2</span> | |||
# <span class="_toggler-toggler1 toggler2">Toggle #1</span> | |||
===Toggling table rows=== | |||
{| border="1" | |||
|- class="row1" | |||
|Row 1, Column 1 | |||
|Row 1, Column 2 | |||
|- class="row2" | |||
|Row 2, Column 1 | |||
|Row 2, Column 2 | |||
|} | |||
*<span class="_toggler-row1">Toggle row 1</span> | |||
*<span class="_toggler-row2">Toggle row 2</span> | |||
===Remote action=== | ===Remote action=== | ||
Line 32: | Line 51: | ||
==Templates== | ==Templates== | ||
Templates can make this much easier to use. | Templates can make this much easier to use. Some existing templates are: | ||
* [[Template:Hide]] | * [[Template:Hide]] | ||
* [[Template:Show hide all]], [[Template:Show all]], [[Template:Hide all]] | |||
* [[Template:Toggle]] | * [[Template:Toggle]] | ||
* [[Template:Toggler]] | * [[Template:Toggler]] |
Revision as of 21:03, 19 March 2007
This feature allows for toggling the visibility of any part of the page.
Fun Examples
Probably the best way to learn how the toggle code works is to look at some examples (and be sure to look at the source of this page).
Simple hiding
hello world
Multiple
- item1
- item2
- toggle item1
- toggle item2
- toggle both items
Show hide all
[show all] [hide all]
Mutual toggling
- Toggle #2
- Toggle #1
Toggling table rows
Row 1, Column 1 | Row 1, Column 2 |
Row 2, Column 1 | Row 2, Column 2 |
- Toggle row 1
- Toggle row 2
Remote action
Nesting
[open level 1 ]
Templates
Templates can make this much easier to use. Some existing templates are:
- Template:Hide
- Template:Show hide all, Template:Show all, Template:Hide all
- Template:Toggle
- Template:Toggler
Technical Details
See MediaWiki:Common.js for the javascript code.