Owlcarousel2 - 如何检查最后一项

时间:2016-01-18 17:22:35

标签: javascript owl-carousel-2

如何查看最后一项?在版本1中有函数“maximumItem”

afterAction: function () {
if (this.currentItem == this.maximumItem) {
}

1 个答案:

答案 0 :(得分:1)

$(".owl-carousel").on('initialized.owl.carousel changed.owl.carousel refreshed.owl.carousel', function (e) {
    if (!e.namespace) return;
    var carousel = e.relatedTarget,
        current = carousel.current();
    if (current === carousel.maximum()) {
      ...
    }
});