There is also a pure CSS solution. It works even when resized.
.fancybox-type-iframe .fancybox-inner{
padding-top: 56.2%;
height: 0 !important;
}
.fancybox-type-iframe .fancybox-inner .fancybox-iframe{
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
I assume you need this for a video displayed using fancybox. Hence related to iframe css.
PS I know that this branch is outdated. But maybe someone still needs a solution.
source
share