21 lines
427 B
JavaScript
21 lines
427 B
JavaScript
function get_height(container, ratio) {
|
|
var height = $(container).width() / ratio
|
|
return height
|
|
}
|
|
|
|
function adjust_height() {
|
|
$(".embeded-vimeo-wrapper").each(function() {
|
|
var iframe = $(this).find('iframe')
|
|
var ratio = $(iframe).attr('ratio')
|
|
$(iframe).prop("height", get_height(iframe, ratio))
|
|
});
|
|
}
|
|
|
|
jQuery(document).ready(function() {
|
|
adjust_height();
|
|
});
|
|
|
|
$(window).resize(function() {
|
|
adjust_height();
|
|
});
|