0
我的貓頭鷹傳送帶上的afterAction函數有問題。 問題是afterAction:當動作「function(current)」在代碼中的第二個時,syncPosition不起作用。如果我刪除它,syncPosition就起作用。如何玩OwlCarousel中的兩個afterActions
目前我無法做一個小提琴,但也許你們中的一些人可以看到拼寫錯誤或下面的東西。
UPDATE //整個代碼
$(document).ready(function() {
$(".owl-carousel").owlCarousel({
loop: false,
navigation: true,
pagination: true,
paginationSpeed: 1000,
singleItem: true,
transitionStyle: "mask",
autoHeight: true,
autoPlay: 10000, //Set AutoPlay to 3 seconds
navigationText : false,
afterAction: syncPosition,
afterAction: function(current) {
current.find('video').get(0).play();
}
});
function syncPosition(el) {
var current = this.currentItem;
// code for smooth transition
this.owl.owlItems.removeClass('turn-on');
var t = this;
$(this.owl.owlItems[this.owl.currentItem]).addClass('turn-on');
}
});
$(window).scroll(function() {
if ($(this).scrollTop() > 80) {
$('.owl-pagination').addClass('hidden');
} else {
$('.owl-pagination').removeClass('hidden');
}
});