2014-09-02 3 views
1

멋진 jquery 플러그인을 사용하면 배너를 회전시킬 수 있습니다. 모든 스크립트는 내가 SB는 DIV 위의 이미지에 맞게하는 방법을 알고,JSSOR, 부모 div 크기에 맞게 이미지

<div style="background-color:black; width:70%; height:300px;" class="adv">. 

어쩌면 사업부에 유의하십시오.

도움이 필요하시면 Thx.

답변

1

위와 같이 컨테이너에 슬라이더를 놓은 다음 슬라이더를 컨테이너의 너비에 맞게 조정할 수 있습니다.

<div style="background-color:black; width:70%;" class="adv"> 
    <div id="slider1_container" ...> 
     ... 
    </div> 
</div> 


    <script> 
     ... 
     var jssor_slider1 = new $JssorSlider$(...; 

     //responsive code begin 
     //you can remove responsive code if you don't want the slider scales while window resizes 
     function ScaleSlider() { 
      var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth; 
      if (parentWidth) 
       jssor_slider1.$ScaleWidth(parentWidth); 
      else 
       window.setTimeout(ScaleSlider, 30); 
     } 

     ScaleSlider(); 
     $Jssor$.$AddEvent(window, "load", ScaleSlider); 

     $Jssor$.$AddEvent(window, "resize", $Jssor$.$WindowResizeFilter(window, ScaleSlider)); 
     $Jssor$.$AddEvent(window, "orientationchange", ScaleSlider); 
     ////responsive code end 

    </script> 
관련 문제