【发布时间】:2017-09-20 11:29:22
【问题描述】:
我必须为看不见的盒子做柜台之类的东西。如果我滑动到结束,计数器应该是'0'。如果它刚刚开始的计数器应该只显示我仍然没有看到的那些(例如它应该是 3)
我做了类似的东西,但是里面有错误,无法处理
jquery 或 javascript https://jsbin.com/vifakamaha/edit?html,js,output
var owl = $('.owl-carousel');
owl.owlCarousel({
items: 4,
responsive: {
0 : {
items: 1
},
500 : {
items: 2
},
991 : {
items: 3
},
1200 : {
items: 4
},
}
});
var nextAfterActive = $(".owl item.active").last().nextAll().length;
$('.count').html(nextAfterActive);
owl.on('changed.owl.carousel', function(event) {
var nextAfterActive = $(".owl-item.active").last().nextAll().length;
$('.count').html(nextAfterActive);
})
【问题讨论】:
-
响应式现在已经不重要了。我知道如何编辑帖子
标签: javascript jquery owl-carousel