resolves js namespace conflict

This commit is contained in:
buttle 2021-08-30 19:01:02 +02:00
parent a7ad58b452
commit 267d382535
1 changed files with 6 additions and 11 deletions

View File

@ -1,20 +1,15 @@
function get_height(container, ratio) { function adjust_vimeo_height() {
var height = $(container).width() / ratio
return height
}
function adjust_height() {
$(".embeded-vimeo-wrapper").each(function() { $(".embeded-vimeo-wrapper").each(function() {
var iframe = $(this).find('iframe') var iframe = $(this).find('iframe')
var ratio = $(iframe).attr('ratio') var height = $(iframe).width() / $(iframe).attr('ratio')
$(iframe).prop("height", get_height(iframe, ratio)) $(iframe).prop("height", height)
}); });
} }
jQuery(document).ready(function() { jQuery(document).ready(function() {
adjust_height(); adjust_vimeo_height();
}); });
$(window).resize(function() { $(window).resize(function() {
adjust_height(); adjust_vimeo_height();
}); });