2017-09-20 1 views
0

보이지 않는 상자에 카운터와 같은 것을 만들어야합니다. 끝까지 슬라이드하면 카운터는 '0'이어야합니다. 그 막 시작 카운터를 표시해야하는 경우에만 내가 아직 보지 않은 사람들은 내가 비슷한했습니다올빼미 회전 목마 - 비활성 슬라이드 수를 계산하십시오.

(예에서 3이어야 함),하지만 버그를 가지고 있고, 단지 그것을

를 처리 할 수 ​​없습니다

JQuery와 또는 자바 스크립트 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); 
}) 
+0

응답은 지금 중요하지 않습니다. Idk 어떻게 게시물을 편집 – Albert

답변

0

난 내가 당신이 dragged 이벤트를 사용해야한다고 생각,이 owl carousel's API docs에서 올바른 이벤트를 사용하고 생각하지 않는다 예 :

owl.on('dragged.owl.carousel', function(event) { 
    var nextAfterActive = $(".owl-item.active").last().nextAll().length; 
    $('.count').html(nextAfterActive); 
}) 

+0

굉장, 고마워! – Albert

관련 문제