yoohoo! hot sauce please
10:27, 7 September 2026 (UTC)
Editing
2swagg wiki:Collapsing objects
(section)
From 2swagg wiki
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===mw-customtoggle=== Another method replies on adding a customized <code>mw-customtoggle-</code> class to the element serving as a toggle link or button and add a customized <code>mw-customcollapsible-</code> id to the collapsible content. This method allow the toggle link to be anywhere on the webpage and to be stylized by users. <pre style="white-space:pre-wrap;"> <span class="mw-customtoggle-customtoggle01" style="color:hotpink; font-weight:bold; cursor:pointer;">[Toggle link]</span> <div id="mw-customcollapsible-customtoggle01" class="mw-collapsible mw-collapsed" style="max-width:300px; border:1px #000 solid; padding:5px;">Content</div> </pre> <span class="mw-customtoggle-customtoggle01" style="color:hotpink; font-weight:bold; cursor:pointer;">[Toggle link]</span> <div id="mw-customcollapsible-customtoggle01" class="mw-collapsible mw-collapsed" style="max-width:300px; border:1px #000 solid; padding:5px;">Content</div> ====Custom toggle link with toggleable text==== In order to have the toggle link or button change with each click, have a separate element for the "show" link and a separate element for the "hide" link and add the <code>collapsibletoggletext</code> to them. If you want the content to be initially non-collapsed by default, add the <code>hiddentext</code> class to the "show" link. If you want the content to be initially collapsed by default, add the <code>hiddentext</code> class to the "hide" link and add the <code>mw-collapsed</code> class to the content that is initially collapsed. Have a container element with the <code>collapsibletoggle</code> surround the "show" and "hide" links. The following is an example of a collapsible object that is initially non-collapsed by default: <pre style="white-space:pre-wrap;"> <span class="mw-customtoggle-customtoggle02 collapsibletoggle" style="color:hotpink; font-weight:bold; cursor:pointer;"><span class="collapsibletoggletext hiddentext">[Show content]</span><span class="collapsibletoggletext">[Hide content]</span></span> <div id="mw-customcollapsible-customtoggle02" class="mw-collapsible mw-collapsed" style="max-width:300px; border:1px #000 solid; padding:5px;">Collapsible content</div> </pre> <span class="mw-customtoggle-customtoggle02 collapsibletoggle" style="color:hotpink; font-weight:bold; cursor:pointer;"><span class="collapsibletoggletext hiddentext">[Show content]</span><span class="collapsibletoggletext">[Hide content]</span></span> <div id="mw-customcollapsible-customtoggle02" class="mw-collapsible" style="max-width:300px; border:1px #000 solid; padding:5px;">Collapsible content</div> The following is an example of a collapsible object that is initially collapsed by default: <pre style="white-space:pre-wrap;"> <span class="mw-customtoggle-customtoggle03 collapsibletoggle" style="color:hotpink; font-weight:bold; cursor:pointer;"><span class="collapsibletoggletext">[Show content]</span><span class="collapsibletoggletext hiddentext">[Hide content]</span></span> <div id="mw-customcollapsible-customtoggle03" class="mw-collapsible mw-collapsed" style="max-width:300px; border:1px #000 solid; padding:5px;">Collapsible content</div> </pre> <span class="mw-customtoggle-customtoggle03 collapsibletoggle" style="color:hotpink; font-weight:bold; cursor:pointer;"><span class="collapsibletoggletext">[Show content]</span><span class="collapsibletoggletext hiddentext">[Hide content]</span></span> <div id="mw-customcollapsible-customtoggle03" class="mw-collapsible mw-collapsed" style="max-width:300px; border:1px #000 solid; padding:5px;">Collapsible content</div>
Summary:
Please note that all contributions to 2swagg wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
2swagg wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Project page
Discussion
Read
Edit source
History
Page actions
Project page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
janny
Noticeboard
Tools
What links here
Related changes
Special pages
Page information