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

Материал из Аэроскан Сервис
Перейти к: навигация, поиск
(Formatted docs a bit. Directed red link to MW.org. +Category:Image Templates)
Строка 1: Строка 1:
 
<div class="hoverbox">
 
<div class="hoverbox">
<div class="hoveritem selected">
+
<div class="hoveritem{{#if:{{{overlay|}}}| selected}}"{{#if:{{{Overlay|}}}| style="visibility:visible; position:relative;"}}>
 
[[Image:{{{1}}}{{#if:{{{link|}}}|{{!}}link={{{link}}}}}{{#if:{{{alt|}}}|{{!}}alt={{{alt}}}}}{{#if:{{{10|}}}|{{!}}{{{10}}}}}{{#if:{{{9|}}}|{{!}}{{{9}}}}}{{#if:{{{8|}}}|{{!}}{{{8}}}}}{{#if:{{{7|}}}|{{!}}{{{7}}}}}{{#if:{{{6|}}}|{{!}}{{{6}}}}}{{#if:{{{5|}}}|{{!}}{{{5}}}}}{{#if:{{{4|}}}|{{!}}{{{4}}}}}{{#if:{{{3|}}}|{{!}}{{{3}}}}}]]
 
[[Image:{{{1}}}{{#if:{{{link|}}}|{{!}}link={{{link}}}}}{{#if:{{{alt|}}}|{{!}}alt={{{alt}}}}}{{#if:{{{10|}}}|{{!}}{{{10}}}}}{{#if:{{{9|}}}|{{!}}{{{9}}}}}{{#if:{{{8|}}}|{{!}}{{{8}}}}}{{#if:{{{7|}}}|{{!}}{{{7}}}}}{{#if:{{{6|}}}|{{!}}{{{6}}}}}{{#if:{{{5|}}}|{{!}}{{{5}}}}}{{#if:{{{4|}}}|{{!}}{{{4}}}}}{{#if:{{{3|}}}|{{!}}{{{3}}}}}]]
 
</div>
 
</div>
<div class="hoveritem">
+
<div class="hoveritem" style="{{#if:{{{HoverPosLeft|}}}|left: {{{HoverPosLeft}}};}} {{#if:{{{HoverPosTop|}}}|top: {{{HoverPosTop}}};}}"}}>
 
[[Image:{{{2}}}{{#if:{{{link|}}}|{{!}}link={{{link}}}}}{{#if:{{{alt|}}}|{{!}}alt={{{alt}}}}}{{#if:{{{3|}}}|{{!}}{{{3}}}}}{{#if:{{{4|}}}|{{!}}{{{4}}}}}{{#if:{{{5|}}}|{{!}}{{{5}}}}}{{#if:{{{6|}}}|{{!}}{{{6}}}}}{{#if:{{{7|}}}|{{!}}{{{7}}}}}{{#if:{{{8|}}}|{{!}}{{{8}}}}}{{#if:{{{9|}}}|{{!}}{{{9}}}}}{{#if:{{{10|}}}|{{!}}{{{10}}}}}]]
 
[[Image:{{{2}}}{{#if:{{{link|}}}|{{!}}link={{{link}}}}}{{#if:{{{alt|}}}|{{!}}alt={{{alt}}}}}{{#if:{{{3|}}}|{{!}}{{{3}}}}}{{#if:{{{4|}}}|{{!}}{{{4}}}}}{{#if:{{{5|}}}|{{!}}{{{5}}}}}{{#if:{{{6|}}}|{{!}}{{{6}}}}}{{#if:{{{7|}}}|{{!}}{{{7}}}}}{{#if:{{{8|}}}|{{!}}{{{8}}}}}{{#if:{{{9|}}}|{{!}}{{{9}}}}}{{#if:{{{10|}}}|{{!}}{{{10}}}}}]]
 
</div>
 
</div>
Строка 11: Строка 11:
 
{{clear}}
 
{{clear}}
 
== Documentation ==
 
== Documentation ==
This template generates an image which changes when you hover over it (e.g. if visual users place their mouse over the image).
+
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).
  
 +
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
 +
 +
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
 +
It is intended
 
=== Examples ===
 
=== Examples ===
 
{| class="wikitable"
 
{| class="wikitable"
 
! Markup || Display
 
! Markup || Display
 
|-
 
|-
| <pre>{{HoverImage|Gerbera_pink.jpg|Nymphaea tetragona.jpg|200px}}</pre>
+
| <nowiki>The famous picture of
|{{HoverImage|Gerbera_pink.jpg|Nymphaea tetragona.jpg|200px}}
+
{{HoverImage|Lenin_addressing_the_troops_-_May_5_1920_-_Altered.jpg|RedSqlenintrotsky.jpg|200px|HoverPosTop=20px}}
 +
Hover over the image to see the
 +
</nowiki>
 +
|Here is some surrounding text
 +
{{HoverImage|Lenin_addressing_the_troops_-_May_5_1920_-_Altered.jpg|RedSqlenintrotsky.jpg|200px|HoverPosTop=20px}}
 +
{{Lorem}}
 +
|-
 +
| <pre>Here is some surrounding text
 +
{{HoverImage|Gerbera_pink.jpg|Nymphaea tetragona.jpg|200px|Pink|Waterlily|thumb}}
 +
{{Lorem}}</pre>
 +
|Here is some surrounding text
 +
{{HoverImage|Gerbera_pink.jpg|Nymphaea tetragona.jpg|200px|Pink|Waterlily|thumb}}
 +
{{Lorem}}
 
|-
 
|-
| <pre>{{HoverImage|Gerbera_pink.jpg|Nymphaea tetragona.jpg|200px|Pink|Waterlily|thumb}}</pre>
+
| <pre>Here is some surrounding text
| {{HoverImage|Gerbera_pink.jpg|Nymphaea tetragona.jpg|200px|Pink|Waterlily|thumb}}
+
{{HoverImage|Gerbera_pink.jpg|Nymphaea tetragona.jpg|200px|Pink|Waterlily|thumb|none}}
 +
{{Lorem}}</pre>
 +
|Here is some surrounding text
 +
{{HoverImage|Gerbera_pink.jpg|Nymphaea tetragona.jpg|200px|Pink|Waterlily|thumb|none}}
 +
{{Lorem}}
 
|}
 
|}
 
=== Limitations ===
 
=== Limitations ===

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

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

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

Шаблон:Clear

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).

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

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 It is intended

Examples

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

[[File:Lenin_addressing_the_troops_-_May_5_1920_-_Altered.jpgШаблон:!200px]]

Шаблон: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)