图像内容

设定

为了使图像自动适合滑块容器,请在宽度上使用100% <img>. Check 的CSS below

$(document).ready(function() {

  $("#owl-demo").owlCarousel({

      autoPlay: 3000, //Set AutoPlay to 3 seconds

      items : 4,
      itemsDesktop : [1199,3],
      itemsDesktopSmall : [979,3]

  });

});
<div id="owl-demo">
          
  <div class="item"><img src="assets/owl1.jpg" alt=" 猫头鹰图片 "></div>
  <div class="item"><img src="assets/owl2.jpg" alt=" 猫头鹰图片 "></div>
  <div class="item"><img src="assets/owl3.jpg" alt=" 猫头鹰图片 "></div>
  <div class="item"><img src="assets/owl4.jpg" alt=" 猫头鹰图片 "></div>
  <div class="item"><img src="assets/owl5.jpg" alt=" 猫头鹰图片 "></div>
  <div class="item"><img src="assets/owl6.jpg" alt=" 猫头鹰图片 "></div>
  <div class="item"><img src="assets/owl7.jpg" alt=" 猫头鹰图片 "></div>
  <div class="item"><img src="assets/owl8.jpg" alt=" 猫头鹰图片 "></div>

</div>
#owl-demo .item{
  margin: 3px;
}
#owl-demo .item  img {
  display: block;
  width: 100%;
  height: auto;
}

更多演示