Owl Carousel视频没有响应调整大小

use*_*219 11 html javascript video jquery

我得到静态图像来调整大小,但是当调整浏览器大小时视频不会.这可能是因为我在脚本中添加了一个宽度.但是,如果我离开videoWidth: true,那么视频会变得很小.

在网站上(http://imdarrien.com/work/Kami/kami.html)

https://jsfiddle.net/9NJ2k/6/

以下是该网站的官方演示(http://www.owlcarousel.owlgraphic.com/demos/video.html)

video:true,
videoHeight: 500,
videoWidth: 856, 


.owl-carousel .owl-video-wrapper {
position: relative;
height: 100%;
background: #000;
}

.owl-carousel .owl-video-play-icon {
position: absolute;
height: 80px;
width: 80px;
left: 50%;
top: 50%;
margin-left: -40px;
margin-top: -40px;
background: url(play_button.png) no-repeat;
cursor: pointer;
z-index: 1;
-webkit-backface-visibility: hidden;
opacity:1;
transition: all 1s;
}
Run Code Online (Sandbox Code Playgroud)

什么时候 videoWidth: false 当<code> videoWidth:false </ code>时

Ezh*_*per 9

通过添加"responsive:true"选项并更改视频标签宽度100%;高度:自动,您可以获得视频响应.

演示:http://jsfiddle.net/nLz17fcv/5/

脚本:

 $(document).ready(function() {
   $("#carousel").owlCarousel({
     items:1,
     autoPlay : 5500,
     stopOnHover : true,
     center:true,
     navigation:false,
     pagination:false,
     goToFirstSpeed : 1300,
     singleItem : true,
     autoHeight : true,
     responsive: true,
     responsiveRefreshRate : 200,
     responsiveBaseWidth: window,      
     video:true,    
     transitionStyle:"fade",
     onTranslate: function() {
       $('.owl-item').find('video').each(function() {
         this.pause();
       });
    }
  });
 })
Run Code Online (Sandbox Code Playgroud)

CSS

    .owl-carousel  {width:90%; margin: 0 auto;}
    .owl-carousel img{width:100%;height:auto;}
Run Code Online (Sandbox Code Playgroud)