본문 바로가기

코딩/JAVASCRIPT

bxslider 탭에서 auto 롤링 오류날때

	$(function(){
        var settings = function() {
            var settingOff = {
                slideWidth: 680,
                mode: 'vertical',
                infiniteLoop:true,
                minSlides:8,
                maxSlides:8,
                moveSlides:1,
                controls:false,
                slideMargin:7,
                pager: false,
                auto: false
            }

            var settingOn = {
                slideWidth: 680,
                mode: 'vertical',
                infiniteLoop:true,
                minSlides:8,
                maxSlides:8,
                moveSlides:1,
                controls:false,
                slideMargin:7,
                pager: false,
                auto: true,
                pause: 1000
            }
            
            // 첫번째인지 확인
            return (firstSec == true) ? settingOn : settingOff;
        }

        var firstSec = true;
        var chatSlide;
        chatSlide = $('.chat_list').bxSlider(settings());

        $('.chat_list').bxSlider(settings());

		$('.tab_slide .tab_list li').click(function(){
			
			$('.tab_slide .tab_con .slide_con').eq($(this).index()).addClass('on').siblings().removeClass('on');	//해당 탭내용DIV 열고 나머지 닫기

            if($(this).index() > 1) {
                firstSec = false;
                chatSlide.reloadSlider(settings());
            } else { //첫번째일때
                firstSec = true;
                chatSlide.reloadSlider(settings());
            }
		});
	});