Template:Tooltip: Difference between revisions
Jump to navigation
Jump to search
(Created page with "<includeonly><span class="explain" title="{{{1}}}">{{{2}}}</span></includeonly><noinclude> {{Tooltip|This is a handy little tooltip!|Hover your cursor over me.}}<br> Use this...") |
(Typing the display text, *then* the tooltip seems more intuitive to me. Also added the ability to hide the dashed underline if required.) |
||
Line 1: | Line 1: | ||
<includeonly><span | <includeonly><span style="cursor:help; <!-- | ||
{{Tooltip|This is a handy little tooltip | --> {{#if: {{{nodash|}}}||{{#ifeq: {{{3|}}}|nodash||border-bottom:thin dotted;}}}}" id="tooltip"<!-- | ||
Use this to | --> title="{{{tip|{{{2|}}}}}}">{{{display|{{{1}}}}}}</span><!-- | ||
--></includeonly><noinclude> | |||
{{Tooltip|Hover your cursor over me!|This is a handy little tooltip.}} | |||
Use this to make a tooltip that displays when a user hovers their mouse cursor over a string of text. The resulting text will have a dotted underline to indicate that it contains a tooltip. | |||
==Usage== | ==Usage== | ||
<code><nowiki>{{Tooltip| | <code><nowiki>{{Tooltip|display text|hover text}}</nowiki></code> | ||
< | * Replace <code>display text</code> with whatever text you want to display initially. | ||
< | * Replace <code>hover text</code> with text that you want to be displayed when hovering the cursor over the affected string.<br> | ||
* Add a <code>nodash</code> or <code>nodash=y</code> argument to hide the dashed underline if required. Not recommended in most cases. | |||
===Examples=== | |||
<code><nowiki>{{Tooltip|Display text|Hover text}}</nowiki></code><br> | |||
{{Tooltip|Display text|This is a handy little tooltip.}} | |||
<code><nowiki>{{Tooltip|Display text with no underline|Hover text|nodash}}</nowiki></code> (Not recommended)<br> | |||
{{Tooltip|Display text with no underline|Hover text|nodash}} | |||
[[Category:Templates]]</noinclude> | [[Category:Templates]]</noinclude> |
Revision as of 01:48, 17 August 2022
Hover your cursor over me!
Use this to make a tooltip that displays when a user hovers their mouse cursor over a string of text. The resulting text will have a dotted underline to indicate that it contains a tooltip.
Usage
{{Tooltip|display text|hover text}}
- Replace
display text
with whatever text you want to display initially. - Replace
hover text
with text that you want to be displayed when hovering the cursor over the affected string. - Add a
nodash
ornodash=y
argument to hide the dashed underline if required. Not recommended in most cases.
Examples
{{Tooltip|Display text|Hover text}}
Display text
{{Tooltip|Display text with no underline|Hover text|nodash}}
(Not recommended)
Display text with no underline