Difference between revisions of "HoverLink"
(Created page with "<noinclude>This template takes two parameters (link=yes/no and dotted=yes/no), and creates underlined text with a hover box for many modern browsers supporting CSS. Here are...") |
m (→Examples: Categorizing templates to organize) |
||
Line 51: | Line 51: | ||
</noinclude><includeonly>{{#ifeq:{{{link}}}|yes|[[{{{2}}}|<span title="{{{1}}}" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>{{{2}}}</span>]]|<span title="{{{1}}}" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>{{{2}}}</span>}}</includeonly><noinclude>[[Category:Help]]</noinclude> | </noinclude><includeonly>{{#ifeq:{{{link}}}|yes|[[{{{2}}}|<span title="{{{1}}}" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>{{{2}}}</span>]]|<span title="{{{1}}}" {{#ifeq:{{{dotted|yes}}}|no||style="border-bottom:1px dotted"}}>{{{2}}}</span>}}</includeonly><noinclude>[[Category:Help]]</noinclude> | ||
+ | |||
+ | <noinclude>[[Category:Utility Templates|{{PAGENAME}}]]</noinclude> |
Latest revision as of 02:01, 16 August 2022
This template takes two parameters (link=yes/no and dotted=yes/no), and creates underlined text with a hover box for many modern browsers supporting CSS.
Here are some ways to create mouse-over effects
.
Using mouse-over effects on wiki text can improve usability.
Examples
Hover over me.
Syntax: <span title="Hello, how are you ?" >Hover over me.</span>
Using: Template:HoverLink
The default is a dotted underline
Hover here
- Syntax: {{HoverLink|This is mouse-over text|Hover here}}
(with link)
- Syntax: {{HoverLink|link=yes|This link will take you to the Main page|Main page}}
To not have a dotted underline, add dotted=no
Hover here
- Syntax: {{HoverLink|dotted=no|This is mouse-over text|Hover here}}
(with link)
- Syntax: {{HoverLink|link=yes|dotted=no|This link will take you to the Main page|Main page}}
- Notes
Template:HoverLink could be further developed with a 3rd parameter to deal with the situation where one wants to create a link (page name), a link alias, and mouse-over text.
In wiki text, this can presently be done like this:
link alias (note that the link goes to Wikiversity:Sandbox)
- Syntax: [[Wikiversity:Sandbox|<span title="mouse-over text">link alias</span>]] (note that the link goes to [[Wikiversity:Sandbox]])