Hide pager if bxslider has only 1 slide

by 조쉬 posted Nov 07, 2018
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄

I faced the same trouble and here is my solution: we should count how many child elements we have under .bxslider2 block


$("#ticket-list li").length


and if there is only one, then set option to 'false', otherwise to 'true'.


$('.bxslider2').bxSlider({

   mode: 'horizontal',

   speed: '180',

   pagerType:'full',

   pager: ($("#ticket-list li").length > 1) ? true: false,

   captions: false

 });


Hope it will helps.