I am using Cycle2 to create a jQuery image carousel which scrolls horizontally. The images are all of uniform height (200px) but have different widths.
This is the code used to display the carousel:
<div id="outer">
<div id="prev"></div>
<div id="inner"
class="cycle-slideshow"
data-cycle-fx="carousel"
data-cycle-timeout="0"
data-cycle-prev="#prev"
data-cycle-next="#next"
data-cycle-slides="a"
>
<a href="/images/01.png" /><img src="/images/200/01.png" /></a>
<a href="/images/02.png" /><img src="/images/200/02.png" /></a>
...
<a href="/images/12.png" /><img src="/images/200/12.png" /></a>
</div>
<div id="next"></div>
</div>
... and this is the result in a browser:
There are actually four separate images shown in the carousel, but no spacing between them.
This is the result I am looking for:
I would like to add a right margin to images in a Cycle2 carousel, but when I modify the img
or a
element to include a margin or padding, the carousel does not 'zero' to the left correctly.
Instead, the carousel appears to be offset to the left such that the first image is partially hidden. In the following picture, I have added margin-right: 10px
to each a
element:
Could anyone suggest what to do to add margin or padding to the images, other than generating images which include a blank area around the main artwork?
Thanks.