Template:Tooltip/doc

Template:Tooltip and Template:Tooltip text are templates is for generating clickable tooltips to show additional information. They are to be used together.

Usage
Tooltip usage is much like references. A small snippet is placed in the text to define the position of the tooltip, and the full tooltip text is specified elsewhere.

The tooltip position is specified by Template:Tooltip. The tooltip content is specified by Template:Tooltip text. The two are linked together by a name. Each tooltip text must have a unique name, but many tooltips can refer to that name, to have the same tooltip appear in multiple places. The name is not displayed visibly to the reader. If a name is not specified for a template, a script error is thrown.

The content of a tooltip can be any normal wikicode. Remeber to escape | in tables! (use, or HTML notation   etc.

Basic
The most basic usage is to use the templates with minimal inputs. The required inputs are: tooltip name

Lorem ipsum dolor sit amet, consectetur adipiscing elit.example1
 * Example

Lorem ipsum dolor sit amet, consectetur adipiscing elit.example1

Advanced
The tooltip templates have a few additional parameters, which come with defaults: name


 * Additional specification
 * limitwidth

limitwidth will automatically apply a maximum width to the tooltip, to keep it within content.

Without limitwidth, the default maximum width is 80% of the entire browser window (the body tag). With limitwidth enabled, it is limited to the width of the (larger) gap between the click point and the edge of content (the tag with id=mw-content-text).


 * style

The following styles are set during script runtime so can't be used by this parameter:
 * left
 * right
 * top
 * max-width (if using limitwidth)

Module
To use tooltips within a module, require Module:Tooltip. The  and   functions are available to use to generate the clickable span and the tooltip content, respectively. They accept the same parameters as the templates, in a table.

Examples
Lorem ipsum dolor sit amet, consectetur adipiscing elit.altclick
 * alt text

Lorem ipsum dolor sit amet, consectetur adipiscing elit.altclick

Lorem ipsum dolor sit amet, consectetur adipiscing elit.noarrow
 * No arrow

Lorem ipsum dolor sit amet, consectetur adipiscing elit.noarrow

Lorem ipsum dolor sit amet, consectetur adipiscing elit.largearrow
 * Larger arrow

Lorem ipsum dolor sit amet, consectetur adipiscing elit.largearrow

Lorem ipsum dolor sit amet, consectetur adipiscing elit.limitedwidth
 * Limited width comparison

Lorem ipsum dolor sit amet, consectetur adipiscing elit.unlimitedwidth

Lorem ipsum dolor sit amet, consectetur adipiscing elit.limitedwidth

Lorem ipsum dolor sit amet, consectetur adipiscing elit.unlimitedwidth

Lorem ipsum dolor sit amet, consectetur adipiscing elit.style
 * Style

Lorem ipsum dolor sit amet, consectetur adipiscing elit.style

Lorem ipsum dolor sit amet, consectetur adipiscing elit.table
 * Tables

Lorem ipsum dolor sit amet, consectetur adipiscing elit.table