Manual:Collapsible elements

jQuery.makeCollapsible

 * See also jQuery.makeCollapsible documentation for more information about how it works.

This module is in MediaWiki core by default as of MediaWiki 1.18 and higher. Add the class " " to any element (div, table, list, anything) to trigger it.

For previous versions of MediaWiki, there are a few alternatives referenced below:
 * Collapsible tables: Add a simple class to make a table collapsible
 * NavFrame: A small element framework to set up a collapsible structure around any arbitrary content

Example
Result: This text is collapsible.

You can add mw-collapsed after mw-collapsible to have the content collapsed by default when you load the page.

To set the initial state as collapsed add " ", such as seen in the following table:

You can specify which part is the collapsible content.

Result: This text is not collapsible; but the next is collapsible and hidden by default:

You can also use collapsible elements into infoboxes, such as seen in the example on the right.

Source
This module ships with MediaWiki by default. You don't need to copy it to a wiki. The source (if you're interested) is in the repository for mediawiki-core ( and ).

Example
Result:

Title 1 Hello world.

Title 2 Hello world.

Source
Copy and paste the following text into your wiki's MediaWiki:Common.js and MediaWiki:Common.css

Example
Result:

Source
Copy and paste the following text into your wiki's MediaWiki:Common.js (or, if you have Gadgets extension installed, create a gadget for it).