User:Alinor/Template:Tooltip

 {{#ifeq:{{{ajax}}}|yes|{{#tag:nowiki|{{{tooltip}}}}}|{{#ifeq:{{#sub:{{{tooltip}}}|0|2}}|{{{!}}|{{{tooltip}}}|{{{tooltip}}}}}}}

Usage
undefined


 * text sets the text that will be rendered where this template is placed.
 * tooltip sets the wikicode that will be in the tooltip when the text is hovered over.

Optional Parameters

 * If there is more than one tooltip on a page with the same text parameter, only the first one will work. Set the template's id parameter to be unique for each tooltip.
 * If you need to force a particular width for the tooltip, you can set a width parameter with any valid CSS dimension value.
 * Using lots of tooltips on a single page can greatly inflate the size and load time. If you set an ajax parameter to yes, the tooltip will not be loaded until the user hovers over it.

Style

 * You can force border and padding sizes by setting their respective parameters to any valid CSS dimension values. The default is a "1em" padding, and a "1px" border.
 * You can change the background color with the bgcolor parameter (default is "#E9E9E9").
 * You can change the border color with the bordercolor parameter (default is "#A3B1BF").
 * You can change the opacity with an opacity parameter with any decimal value between 0 and 1 (default is 0.92).

Caveats
When using this template in a bulleted or numbered list, normal wikicode parsing rules apply. Specifically, if the text or tooltip parameters expand to something that has a newline in it (such as a table), then the tooltip won't render. To solve this, the list item must be wrapped in its HTML equivalent.

Example
undefined Result: undefined
 * Clicking on the tooltip text (if it isn't a link) will make the tooltip sticky so you can interact with the contents of it. Clicking anywhere else on the page will make it disappear.