Template:Tooltip: Difference between revisions

From HorizonXI Wiki
(Created page with "<onlyinclude><includeonly><span id="{{anchorencode:{{{id|{{{text}}}}}}}}" class="advanced-tooltip" style="border-bottom:{{default|{{{underline|}}}|thin dashed grey}}; cursor:default; display:inline-block;">{{{text}}}<span id="{{anchorencode:{{{id|{{{text}}}}}}}}-tooltip" class="tooltip-contents hidden">{{{tooltip}}}</span></span></includeonly></onlyinclude> __NOTOC__ {{PAGENAMEE}} ==Usage== <pre> {{Tooltip | text = Jugner Forest | tooltip = F...")
Tag: visualeditor-wikitext
 
mNo edit summary
Tag: Reverted
Line 1: Line 1:
importArticles({    type: 'script',    articles: [        'u:dev:MediaWiki:Tooltips.js',    ]});
<onlyinclude><includeonly><span id="{{anchorencode:{{{id|{{{text}}}}}}}}" class="advanced-tooltip" style="border-bottom:{{default|{{{underline|}}}|thin dashed grey}}; cursor:default; display:inline-block;">{{{text}}}<span id="{{anchorencode:{{{id|{{{text}}}}}}}}-tooltip" class="tooltip-contents hidden">{{{tooltip}}}</span></span></includeonly></onlyinclude>
<onlyinclude><includeonly><span id="{{anchorencode:{{{id|{{{text}}}}}}}}" class="advanced-tooltip" style="border-bottom:{{default|{{{underline|}}}|thin dashed grey}}; cursor:default; display:inline-block;">{{{text}}}<span id="{{anchorencode:{{{id|{{{text}}}}}}}}-tooltip" class="tooltip-contents hidden">{{{tooltip}}}</span></span></includeonly></onlyinclude>
__NOTOC__
__NOTOC__

Revision as of 00:39, 11 February 2023

importArticles({ type: 'script', articles: [ 'u:dev:MediaWiki:Tooltips.js', ]});

Usage

{{Tooltip
| text = [[Jugner Forest]]
| tooltip = [[File:JugnerForest.png|300px]]
}}
  • 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).
  • You can change the underline style with the underline parameter (default is "thin dashed grey").

Caveats

When using this template to transclude data that includes a table, it will break.

Example

{{Tooltip
| text = [[Jugner Forest]]
| tooltip = [[File:JugnerForest.png|300px]]
}}

Result: Jugner Forest.

and