pull/55/merge
Oliver Tacke 2021-11-11 11:54:22 +01:00 committed by GitHub
commit cee4446faa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -946,11 +946,14 @@ H5P.QuestionSet = function (options, contentId, contentData) {
if ($intro.length) { if ($intro.length) {
var bgImg = params.introPage.backgroundImage; var bgImg = params.introPage.backgroundImage;
var bgImgRatio = (bgImg.height / bgImg.width); var bgImgRatio = (bgImg.height / bgImg.width);
$intro.css({
background: '#fff url("' + H5P.getPath(bgImg.path, contentId) + '") no-repeat 50% 50%', setTimeout(function () {
backgroundSize: 'auto 100%', $intro.css({
minHeight: bgImgRatio * +window.getComputedStyle($intro[0]).width.replace('px','') background: '#fff url("' + H5P.getPath(bgImg.path, contentId) + '") no-repeat 50% 50%',
}); backgroundSize: 'auto 100%',
minHeight: bgImgRatio * +window.getComputedStyle($intro[0]).width.replace('px','')
});
}, 0);
} }
} }