【发布时间】:2018-04-05 10:26:02
【问题描述】:
我正在使用 Zepto 在我的网站上使用 Siema carousel。我希望能够指出用户当前在哪张幻灯片上。如果只有 onChange 事件可用,我该怎么做?
HTML
<section class="images">
<img/>
<img/>
</section>
<section class="indicators">
<span class="active"></span>
<span></span>
</section>
JS
$(document).ready(function() {
new Siema({
selector: '.images',
onChange: () => {
console.log("swiped");
// change active indicator?
},
});
});
【问题讨论】:
-
在Siema carousel 的 API 部分查看当前幻灯片。这应该有一个你正在寻找的行为的例子。
标签: javascript zepto siema