I'm using the brilliant Cycle2 plugin, and I want to automatically create thumbnails of the images in my slideshow as per this example.
However, that example has the img
itself as the slide each time. Because of my layout, I need the img
to be within a container figure
each time. See below or this fiddle:
<div class="slideshow-listing cycle-slideshow"
data-cycle-slides="figure"
data-cycle-auto-height="4:3"
data-cycle-pager-template="<span><img src='{{src}}' /></span>"
data-pause-on-hover="true">
<figure><img src="http://placehold.it/250x570"></figure>
<figure><img src="http://placehold.it/250x570"></figure>
<figure><img src="http://placehold.it/450x370"></figure>
<figure><img src="http://placehold.it/250x570"></figure>
<figure><img src="http://placehold.it/250x570"></figure>
<div class="cycle-pager"></div>
</div><!-- /slideshow-listing -->
That means that my pager-template cannot access the image source. The docs say that:
Cycle2 uses simple Mustache-style templates by default.
So I am guessing there is a fairly simple way to amend my template to access the img
src
within the figure
each time… I'm just not sure what that is. Thanks in advance.