Шаблон:HoverImage — различия между версиями

Материал из Аэроскан Сервис
Перейти к: навигация, поиск
(Documentation)
Строка 11: Строка 11:
 
{{clear}}
 
{{clear}}
 
== Documentation ==
 
== Documentation ==
This template displays an image which is replaced by another, previously hidden image when the reader hovers over it (e.g. if visual users place their mouse over the image).
+
This template displays a default image, then another image when the reader hovers over it (e.g. if visual users place their mouse over the image). It is primarily intended for showing an undoctored image to the casual reader, but highlighting certain aspects on close inspection.
  
Bear in mind that the casual reader may not see the hidden image, so use of this template may result in hiding information from the reader (usually a '''bad''' thing!). so this template should be used sparingly. In particular, you should avoid superimposing two completely unrelated images, as the hidden image
+
{{warning|This template may hide useful information from the reader, so should be used with caution}}
 +
Bear in mind that the casual reader may not hover over the image, so will not see the intended effect. In addition, it may be difficult to follow links to the default image, as this will change on hovering. For this reason the effect should be designed to be minimal (see examples below). This can be achieved by making the replacement image similar to the default, or by overlaying a smaller image on top of a larger one. 
  
A reasonable use is to have two very similar images: a conventional one, and one with a particular part of the image highlighted. In this instance, a casual reader will see the normal image, but closer inspection will
+
=== Usage ===
It is intended
+
The template is intended to mimic the wikitext convention for  [[mw:Help:images]]. The first ''two'' parameters are the names of the default and hover-revealed images respectively. All other parameters are the same as for [[mw:Help:images]], and are applied simultaneously to both images, apart from the following two exceptions:
 +
* If there is more than one potential caption, then the first caption is used for the default image and the last for the replacement image.
 +
* If the parameter ''Overlay'' is non-blank, then the default image is not hidden (useful for superimposing arrows etc on an original picture).
 +
* The parameters ''HoverPosLeft'' and ''HoverPosTop'' specify the left and top positions of the hover-revealed image (also useful for specifying a position for hover-over images, etc.)
 
=== Examples ===
 
=== Examples ===
 
{| class="wikitable"
 
{| class="wikitable"
Строка 22: Строка 26:
 
|-
 
|-
 
| <nowiki>The famous picture of  
 
| <nowiki>The famous picture of  
{{HoverImage|Lenin_addressing_the_troops_-_May_5_1920_-_Altered.jpg|RedSqlenintrotsky.jpg|200px|HoverPosTop=20px}}
+
{{HoverImage|Lenin_addressing_the_troops_-_May_5_1920_-_Altered.jpg|RedSqlenintrotsky.jpg|HoverPosTop=20px}}
 
Hover over the image to see the  
 
Hover over the image to see the  
 
</nowiki>
 
</nowiki>
 
|Here is some surrounding text
 
|Here is some surrounding text
{{HoverImage|Lenin_addressing_the_troops_-_May_5_1920_-_Altered.jpg|RedSqlenintrotsky.jpg|200px|HoverPosTop=20px}}
+
{{HoverImage|Lenin_addressing_the_troops_-_May_5_1920_-_Altered.jpg|RedSqlenintrotsky.jpg|HoverPosTop=20px}}
 
{{Lorem}}
 
{{Lorem}}
 
|-
 
|-

Версия 12:54, 26 февраля 2009

[[Image:{{{1}}}]]

[[Image:{{{2}}}]]

Шаблон:Clear

Documentation

This template displays a default image, then another image when the reader hovers over it (e.g. if visual users place their mouse over the image). It is primarily intended for showing an undoctored image to the casual reader, but highlighting certain aspects on close inspection.

Bear in mind that the casual reader may not hover over the image, so will not see the intended effect. In addition, it may be difficult to follow links to the default image, as this will change on hovering. For this reason the effect should be designed to be minimal (see examples below). This can be achieved by making the replacement image similar to the default, or by overlaying a smaller image on top of a larger one.

Usage

The template is intended to mimic the wikitext convention for mw:Help:images. The first two parameters are the names of the default and hover-revealed images respectively. All other parameters are the same as for mw:Help:images, and are applied simultaneously to both images, apart from the following two exceptions:

  • If there is more than one potential caption, then the first caption is used for the default image and the last for the replacement image.
  • If the parameter Overlay is non-blank, then the default image is not hidden (useful for superimposing arrows etc on an original picture).
  • The parameters HoverPosLeft and HoverPosTop specify the left and top positions of the hover-revealed image (also useful for specifying a position for hover-over images, etc.)

Examples

Markup Display
The famous picture of {{HoverImage|Lenin_addressing_the_troops_-_May_5_1920_-_Altered.jpg|RedSqlenintrotsky.jpg|HoverPosTop=20px}} Hover over the image to see the Here is some surrounding text

Шаблон:Lorem

Here is some surrounding text
{{HoverImage|Gerbera_pink.jpg|Nymphaea tetragona.jpg|200px|Pink|Waterlily|thumb}}
{{Lorem}}
Here is some surrounding text

Шаблон:Lorem

Here is some surrounding text
{{HoverImage|Gerbera_pink.jpg|Nymphaea tetragona.jpg|200px|Pink|Waterlily|thumb|none}}
{{Lorem}}
Here is some surrounding text

Шаблон:Lorem

Limitations

  • No more than 8 additional parameters after the image names. This should be enough for all the image options
  • This template my need updating if the image syntax changes (e.g. more named parameters allowed)