Template:Tooltip: Difference between revisions

From Imagisphere
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...")
 
m (Consistency in the example.)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly><span class="explain" title="{{{1}}}">{{{2}}}</span></includeonly><noinclude>
<includeonly><span style="cursor:help; <!--
{{Tooltip|This is a handy little tooltip!|Hover your cursor over me.}}<br>
--> {{#if: {{{nodash|}}}||{{#ifeq: {{{3|}}}|nodash||border-bottom:thin dotted;}}}}" id="tooltip"<!--
Use this to create text 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.
--> 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|tooltip|display text}}</nowiki></code>
<code><nowiki>{{Tooltip|display text|hover text}}</nowiki></code>
<tt>tooltip</tt> is what will be display when hovering the cursor over the string of text.<br>
* Replace <code>display text</code> with whatever text you want to display initially.
<tt>display text</tt> is what will initially be displayed to the user.
* 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|Hover text}}
 
<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>

Latest revision as of 17:00, 6 April 2024

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 or nodash=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