Answer the question
In order to leave comments, you need to log in
How to solve the problem with the script - stretching the image to fit the screen?
There is a script like this
c.onload = function () {
var m, g, h, i, j, k, l;
d.attr('src', e.album[f].link);
m = b(c);
d.width(c.width);
d.height(c.height);
if (e.options.fitImagesInViewport) {
l = b(window).width();
k = b(window).height();
j = l - e.containerLeftPadding - e.containerRightPadding - 20;
i = k - e.containerTopPadding - e.containerBottomPadding - 110;
if ((c.width > j) || (c.height > i)) {
if ((c.width / j) > (c.height / i)) {
h = j;
g = parseInt(c.height / (c.width / h), 10);
d.width(h);
d.height(g)
} else {
g = i;
h = parseInt(c.width / (c.height / g), 10);
d.width(h);
d.height(g)
}
} else {
d.width( parseInt(c.width / (c.height / i), 10));
d.height(i);
}
}
return e.sizeContainer(d.width(), d.height())
};
Answer the question
In order to leave comments, you need to log in
<body>
<img src="url" style="width: 100%" />
</body>
background-size: cover;
-o-background-size: cover;
-moz-background-size: cover;
-webkit-background-size: cover;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question