본문 바로가기
jquery

[bxslider.js] nodata 일 때 maxslide 1

by 바나냥 2020. 4. 10.
if($(".mainMenu .slider li").length > 0){

  $(".mainMenu .slider").bxSlider({
    auto: false,
    pager: true,
    controls: false,
    minSlides: 1,
    maxSlides: 3,
    moveSlides: 1,
    slideWidth: 376,
    slideMargin: 36,
    infiniteLoop: false,
    shrinkItems: true,
    touchEnabled : (navigator.maxTouchPoints > 0)

  }); 

  }else {

  $(".mainMenu .slider").bxSlider({
    auto: false,
    pager: true,
    controls: false,
    minSlides: 1,
    maxSlides: 1,
    moveSlides: 1,
    infiniteLoop: false,
    shrinkItems: true,
    touchEnabled : (navigator.maxTouchPoints > 0)

  }); 
}

nodata 는 div 이고 나머지 패키지 리스트는 li 일 때 ..

댓글