More actions
m (adjusted styles so the pagination buttons won't be hidden behind images) |
m (added shorthand "images" parameter - just list the images separated by semicolons) |
||
Line 1: | Line 1: | ||
<includeonly>{{#vardefine:WIDTH|{{#if:{{{width|}}}|{{#expr:{{{width}}}+8}}|208}}}}<div class="jcarousel-wrapper {{{class|}}}" id="{{{id|}}}" style="max-width:{{#var:WIDTH}}px;width:auto;height:auto;max-height:{{{height|}}};{{#ifeq:{{{align|}}}|center|margin-left:auto;margin-right:auto;}}{{#ifeq:{{{align|}}}|right|float:right;clear:right;}}{{#ifeq:{{{align|}}}|floatleft|float:left;clear:left;}}"> | <includeonly>{{#vardefine:WIDTH|{{#if:{{{width|}}}|{{#expr:{{{width}}}+8}}|208}}}}<div class="jcarousel-wrapper {{{class|}}}" id="{{{id|}}}" style="max-width:{{#var:WIDTH}}px;width:auto;height:auto;max-height:{{{height|}}};{{#ifeq:{{{align|}}}|center|margin-left:auto;margin-right:auto;}}{{#ifeq:{{{align|}}}|right|float:right;clear:right;}}{{#ifeq:{{{align|}}}|floatleft|float:left;clear:left;}}"> | ||
{{#if:{{{nopage|}}}||<p class="jcarousel-pagination" style="top:0em;margin-top:0;"></p>}} | {{#if:{{{nopage|}}}||<p class="jcarousel-pagination" style="top:0em;margin-top:0;"></p>}} | ||
<div class="jcarousel jcarousel-{{{mode|stopslider}}}"><div class="jcarousel-list" style="margin-top:2em;">{{{list|}}}</div></div> | <div class="jcarousel jcarousel-{{{mode|stopslider}}}"><div class="jcarousel-list" style="margin-top:2em;"> | ||
{{#arraymap:{{{images|}}}|;|*|<div class="jcarousel-item">[[File:*|thumb|center|{{{width|}}}px]]</div>|}}{{{list|}}}</div></div> | |||
{{#if:{{{noarrow|}}}||<span class="jcarousel-control-prev" style="left:-50px;">[[file:Icon_banner_arrow_left.png|link=#|50px]]</span> | {{#if:{{{noarrow|}}}||<span class="jcarousel-control-prev" style="left:-50px;">[[file:Icon_banner_arrow_left.png|link=#|50px]]</span> | ||
<span class="jcarousel-control-next" style="right:-50px;">[[file:Icon_banner_arrow_right.png|link=#|50px]]</span>}} | <span class="jcarousel-control-next" style="right:-50px;">[[file:Icon_banner_arrow_right.png|link=#|50px]]</span>}} | ||
</div></includeonly> | </div></includeonly> | ||
<noinclude>{{Documentation}}</noinclude> | <noinclude>{{Documentation}} | ||
</noinclude> |
Revision as of 17:50, 8 October 2021
This template is used for a slider made out of thumbnails.
A single list item also has the shortcut template Template:p.
Usage
{{Carousel |width = |align = |list= <div class="jcarousel-item">[[File:exampleimage1.jpg]]</div> <div class="jcarousel-item">[[File:exampleimage2.jpg]]</div> ... }} {{Carousel |width = |align = |list= {{p|[[File:exampleimage1.jpg|thumb|300px]]}} {{p|[[File:exampleimage2.jpg]]}} ... }}
Shorthand using "images" parameter instead of "list"
- List images to have them automatically sized to the given "width" of the carousel. List each item on a separate line.
- Split width, captions, etc. by semicolons
{{Carousel |width=300 |images= image 1.png;300px;Image caption image 2.png;This is an image caption }}
Parameter list
width
Width of the slider. e.g.450
if the series of images are 450px widealign
To have it float to the right, usefloatright
. To have it float to the left, usefloatleft
. To have it centered, usecenter
. To have it without any, usenull
.list
For every slide, start a new line and put<div class="jcarousel-item">[[File:exampleimage.jpg]]</div>
, substituting exampleimage.jpg with the image you desire.images
Shorthand using "images" instead of "list" parameter.
Examples
Using list: {{Carousel |width = 300 |align = |list= <div class="jcarousel-item">[[File:BlazBlue Cross Tag Battle Ragna the Bloodedge Main.png|300x300px|center|thumb|BBTAG]]</div> <div class="jcarousel-item">[[File:BlazBlue Central Fiction Ragna the Bloodedge Main.png|150x150px|center|thumb|BBCF]]</div> <div class="jcarousel-item">[[File:BlazBlue Chrono Phantasma Ragna the Bloodedge Main.png|200x200px|center|thumb|BBCP]]</div> }} |
|
Using {{Carousel |width=300 |images= File:BlazBlue Cross Tag Battle Ragna the Bloodedge Main.png;300px;BBTAG File:BlazBlue Central Fiction Ragna the Bloodedge Main.png;150px;BBCF File:BlazBlue Chrono Phantasma Ragna the Bloodedge Main.png;200px;BBCP }} |
The above documentation is transcluded from Template:Carousel/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |