Resize embedded iframes to content height (this should fix #130)

This commit is contained in:
Bernd Bestel 2019-01-26 19:31:41 +01:00
parent dfc05e0bec
commit 03720940d4
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -463,7 +463,12 @@ ResizeResponsiveEmbeds = function(fillEntireViewport = false)
var maxHeight = $("body").height();
}
$(".embed-responsive").attr("height", maxHeight.toString() + "px");
$("embed.embed-responsive").attr("height", maxHeight.toString() + "px");
$("iframe.embed-responsive").each(function()
{
$(this).attr("height", $(this)[0].contentWindow.document.body.scrollHeight.toString() + "px");
});
}
$(window).on('resize', function()
{