I added to to the iframe a class with css
width:100%;
height:auto;
but does not work for the height.
Any ideas better than jquery dirty fix
$(window).resize(function(){
var tempwidth=$(".vimeoiframe").width();
var tempheight=tempwidth/1.25;
$(".vimeoiframe").css("height",tempheight);
});
Since not all my videos have this aspect ratio.
By simply going to the website and navigating to the “Resize” tab you can quickly upload and resize a video clip.
In the share window that appears, click on "+Show options" in the top right corner of the lightbox, then select "Responsive.” The code in the embed section should then automatically adjust to include a new div wrapper and script tag. These elements allow the iframe to become responsive.
You should take a look at this jQuery plugin, seams that was wrote for you
FitVids.js
There is an entire article about it on CSS Tricks as well
Fluid Width YouTube Videos
And his .net magazine article
Create fluid width videos
Or you could use percentage ratios, http://codepen.io/maxmckenzie/pen/hFzak the video dose not load in codepen for some reason.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With