2016-06-08 1 views
0

올빼미 회전식 메뉴에서 afterAction 기능에 문제가 있습니다. 문제는 afterAction입니다 : 액션 "함수 (현재)"가 코드에있는 경우 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'); 
    } 
}); 

답변

0

나는

afterInit: function(){ 
$("#sequence-1").find('video').get(0).play(); 

afterAction: function(current) { 
current.find('video').get(0).play(); 
} 

을 변경했습니다 모두 syncPosition.find('video').get(0).play(); 는 노력하고 있습니다.

관련 문제