본문 바로가기
jquery

[bxslider.js] 3개 출력 슬라이드에서 startSlide -1 오류

by 바나냥 2020. 4. 6.
$('.photo .slide').each(function(index){
        var $thisObj = $(this);
        var totalCount = new Array();
        totalCount[index] = $thisObj.find('li').length;
        totalN = totalCount - 1;
        $thisObj.bxSlider({
                    auto: false,
                    pager: false,
                    controls: true,
                    minSlides: 3,
                    maxSlides: 3,
                    moveSlides: 1,
                    startSlide: totalN,
                    slideWidth: 1100,
                    slideHeight: 800,
                    slideMargin: 100,
                    nextSelector: '#slider-next2',
                    prevSelector: '#slider-prev2',
                    onSlideNext: function($slideElement, oldIndex, newIndex) {
                        $('.photo .slide li.acco_slide').removeClass('active');
                        $('.photo .slide li.acco_slide').eq(newIndex+4).addClass('active');
                    },
                    onSlidePrev: function($slideElement, oldIndex, newIndex) {
                        $('.photo .slide li.acco_slide').removeClass('active');
                        $('.photo .slide li.acco_slide').eq(newIndex+4).addClass('active');
                    },
                    onSliderLoad: function(currentIndex){
                        $('.photo .slide li.acco_slide').removeClass('active');
                        $('.photo .slide li.acco_slide').eq(currentIndex+4).addClass('active');
                    }
                });
	});

댓글