【发布时间】:2013-09-09 22:29:29
【问题描述】:
我正在使用出色的Cycle2 插件,并且我想按照this example 自动在我的幻灯片中创建图像的缩略图。
但是,该示例每次都将img 本身作为幻灯片。由于我的布局,我需要 img 每次都在容器 figure 内。见下文或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 -->
这意味着我的 pager-template 无法访问图像源。文档说:
Cycle2 默认使用简单的 Mustache 样式模板。
所以我猜有一种相当简单的方法可以修改我的模板以每次访问figure 内的img src……我只是不确定那是什么。提前致谢。
【问题讨论】:
标签: jquery mustache jquery-cycle