Template:Superimpose/doc: Difference between revisions
(Document base_link= and float_link=.) |
|||
Line 12: | Line 12: | ||
| base = US_Locator_Blank.svg | | base = US_Locator_Blank.svg | ||
| base_width = 288px | | base_width = 288px | ||
| base_alt = U.S. | | base_alt = Boulder is in north central Colorado, which in turn is just west of the center of the U.S. | ||
| base_caption = United States Locator Map | | base_caption = United States Locator Map | ||
| float = Red Dot.svg | | float = Red Dot.svg | ||
| float_width = 10px | | float_width = 10px | ||
| float_caption = Boulder, Colorado | | float_caption = Boulder, Colorado | ||
| x = 95 | | x = 95 | ||
Line 22: | Line 21: | ||
}} | }} | ||
</div> | </div> | ||
<pre style="overflow:auto;"> | |||
< | |||
{{Superimpose | {{Superimpose | ||
| base = US_Locator_Blank.svg | | base = US_Locator_Blank.svg | ||
| base_width = 288px | | base_width = 288px | ||
| base_alt = U.S. | | base_alt = Boulder is in north central Colorado, which in turn is just west of the center of the U.S. | ||
| base_caption = United States Locator Map | | base_caption = United States Locator Map | ||
| float = Red Dot.svg | | float = Red Dot.svg | ||
| float_width = 10px | | float_width = 10px | ||
| float_caption = Boulder, Colorado | | float_caption = Boulder, Colorado | ||
| x = 95 | | x = 95 | ||
Line 40: | Line 34: | ||
}} | }} | ||
</pre> | </pre> | ||
<div style="clear: both"></div> | <div style="clear: both"></div> | ||
Line 55: | Line 48: | ||
| float = | | float = | ||
| float_width = | | float_width = | ||
| float_caption = | |||
| x = | |||
| y = | |||
}} | |||
</pre> | |||
The following blank definition includes all the parameters, including those less-commonly used. | |||
<pre> | |||
{{Superimpose| base = | |||
| base_width = | |||
| base_alt = | |||
| base_caption = | |||
| base_link = | |||
| float = | |||
| float_alt = | | float_alt = | ||
| float_width = | |||
| float_caption = | | float_caption = | ||
| float_link = | |||
| x = | | x = | ||
| y = | | y = | ||
Line 68: | Line 78: | ||
* '''base_alt:''' [[Alt text]] for the image, for visually impaired readers; see [[WP:ALT]] | * '''base_alt:''' [[Alt text]] for the image, for visually impaired readers; see [[WP:ALT]] | ||
* '''base_caption:''' Text to show when a user's mouse hovers over the base image | * '''base_caption:''' Text to show when a user's mouse hovers over the base image | ||
* '''base_link:''' Name of page that the user should be sent to if they click on the base image. The special value "<code>file:</code>", stands for the file page for the base image. If empty, nothing happens if the user clicks on the base image. The default is empty is '''base_alt''' is empty (''i.e.'', the image is considered to be [[WP:ALT#Purely decorative images|purely decorative]]), and is "<code>file:</code>" if '''base_alt''' is nonempty. | |||
* '''float:''' File name of the top image | * '''float:''' File name of the top image | ||
* '''float_width:''' Width to display the top image, ''in pixels'' | * '''float_width:''' Width to display the top image, ''in pixels'' | ||
* '''float_alt:''' Alt text for the top image | * '''float_alt:''' Alt text for the top image | ||
* '''float_caption:''' Text to show when a user's mouse hovers over the top image | * '''float_caption:''' Text to show when a user's mouse hovers over the top image | ||
* '''float_link:''' Name of page that the user should be sent to if they click on the top image. This acts like '''base_link''', except it is for the top image. | |||
* '''x:''' distance to offset the top image from the left edge of the base image, ''in pixels or any other CSS-standard units'' | * '''x:''' distance to offset the top image from the left edge of the base image, ''in pixels or any other CSS-standard units'' | ||
* '''y:''' distance to offset the top image from the top edge of the base image, ''in pixels or any other CSS-standard units'' | * '''y:''' distance to offset the top image from the top edge of the base image, ''in pixels or any other CSS-standard units'' |
Revision as of 20:43, 14 October 2009
{{Superimpose/doc}} is a utility which superimposes one image over another, and positions it relative to the top left corner of the bottom image. Although the original idea was to place a dot on a locator map based on editable coordinates, it can be used to precisely overlay any two images for any reason.
Usage
Example
{{Superimpose | base = US_Locator_Blank.svg | base_width = 288px | base_alt = Boulder is in north central Colorado, which in turn is just west of the center of the U.S. | base_caption = United States Locator Map | float = Red Dot.svg | float_width = 10px | float_caption = Boulder, Colorado | x = 95 | y = 80 }}
Using the Template
To get started, you can simply copy this blank definition into your page, and fill in the data.
{{Superimpose| base = | base_width = | base_alt = | base_caption = | float = | float_width = | float_caption = | x = | y = }}
The following blank definition includes all the parameters, including those less-commonly used.
{{Superimpose| base = | base_width = | base_alt = | base_caption = | base_link = | float = | float_alt = | float_width = | float_caption = | float_link = | x = | y = }}
Parameter Definitions
- base: File name of the base (bottom) image
- base_width: Width to display the base image, in pixels
- base_alt: Alt text for the image, for visually impaired readers; see WP:ALT
- base_caption: Text to show when a user's mouse hovers over the base image
- base_link: Name of page that the user should be sent to if they click on the base image. The special value "
file:
", stands for the file page for the base image. If empty, nothing happens if the user clicks on the base image. The default is empty is base_alt is empty (i.e., the image is considered to be purely decorative), and is "file:
" if base_alt is nonempty. - float: File name of the top image
- float_width: Width to display the top image, in pixels
- float_alt: Alt text for the top image
- float_caption: Text to show when a user's mouse hovers over the top image
- float_link: Name of page that the user should be sent to if they click on the top image. This acts like base_link, except it is for the top image.
- x: distance to offset the top image from the left edge of the base image, in pixels or any other CSS-standard units
- y: distance to offset the top image from the top edge of the base image, in pixels or any other CSS-standard units
A Note about the Locator Dot
I originally built this template thinking I could use an SVG file with transparency (mostly for the dot in locator maps). However, it seems Internet Explorer users can't handle transparent PNGs without a fix that Wikimedia's not yet delivering, so for now I recommend using the GIF version in the example above. When IE better supports PNGs, we can swap the better format back in. —Papayoung ☯ 02:06, 26 October 2005 (UTC)
See also
- {{Superimpose2}}, supports more layer superimposition.