Skip to content

Extras

Additional Modes

These modes can be toggled with table arguments (zeroth argument).

Collapsibles

The infobox may create its own collapsible container. This will contain the infobox within a collapsible element. Currently, there is no way to pass arguments to the collapsible elements.

This feature is controlled with the parameter $shouldCollapse. This may be set to true, false, mobile (true when on mobile), or anchored (true when anchored).

By default, the collapsible will use a feature I'm calling dynamic collapse. On uncollapse, the max-height of the content container will be set to the height of its contained infobox (plus that time .2, for wiggle room), and on collapse, set to zero. This ensures that the collapse speed is always consistent, regardless of the infobox's size. The transition itself can of course be overwritten or disabled with CSS. To suppress this behaviour for whatever reason, pass $!dynamicCollapse.

Anchoring

Anchoring allows the infobox to target another element in which to place itself, instead of its natural position. The intended use of this feature is to define an alternate location for the infobox to appear on mobile layouts, in the style of the wikipedia app.

To activate anchoring, pass $shouldAnchor. If set to mobile, anchoring will active only on mobile.

You may also pass $anchorTarget="targetString" to define an anchor target. The first element matching the string targetString will have the infobox appended to it. This function does not discriminate against interface components (such as body), so use caution. If no target is provided, it defaults to div#infobox-anchor. To place such an anchor, add a <div id="infobox-anchor"></div> in your document.