Jssor slider 100% width

后端 未结 5 1663
北荒
北荒 2020-12-03 01:17

I try to get a jssor slider working with 100% width (the container has a width of 70%). The problem is, that jssor only works with pixels, so if I use a slide_container with

5条回答
  •  一生所求
    2020-12-03 02:14

    Using Bootstrap, if you have Jssor inside an X column div, e.g., col-lg-12:

    jssor_slider1.$ScaleWidth(
       Math.max(
          Math.min
           (parseInt($(".col-lg 12").css("width").replace("px", "")) -  
           (parseInt($(".col-lg-12").css("padding-left").replace("px", "")) + 
           parseInt($(".col-lg-12").css("padding-right").replace("px","")))),100));
    

提交回复
热议问题