Collapsers are expandable elements that hide page content until you trigger it open. We use collapsers to hide content in very long documents, out of consideration for our readers. Each collapser has a
title (what we show to readers), but also an
id that we use for deep "anchor" links to specific collapsers.
Here's an example collapser:
Here are some examples of when to use collapsers in your document.
Collapsers are useful for...
Here are examples when you have a long list of definitions, such as configuration values, API calls, or parameters:
Here's an example when you have multiple options, such as a procedure with steps that vary depending on your application environment: Collecting PMI metrics.
Large code blocks
Here's an example when you have a code block that is longer than about one screen height: Writing API tests.
Here's an example when you want a cleaner substitute for
To create a collapser, you'll need to use our collapser code.
Here's an example of the collapser source:
<CollapserGroup><Collapser id="collapser-source" title="Collapser source"><dl class="collapser-list"><dt id="collapser-1">Collapser 1</dt><dd><p>This is the first example collapser.</p></dd><dt id="collapser-2">Collapser 2</dt><dd><p>This is the second example collapser.</p></dd></dl></Collapser></CollapserGroup>;
To open or close a collapser:
- Click the open buttons or Show/Hide All.
- Arrive at an individual collapser via an anchor ID. For example, go directly to Collapser 1 in the example above.
- Type the shortcut key
sto show (open) all collapsers on the page.
- Use CMD+F (or CTRL+F) to find in page and all the collapsers will open automatically.