So I have an image gallery. Each image is a background-image
that stretches across the entire page.
To ensure that every image uses the maximum available width, I give it the following background-size:
background-size: 100% auto;
However, some of the images are taller than the available screen height.
To make sure the image is visible in full (at least using scroll bars), I would need to give the body
element the height of the resized background image.
However, there seems to be no way to get hold of the resized background image's height in JavaScript.
Is this true? Do I have to resort to normal image elements after all?
There are many approaches to getting the size of a static background image, like How do I get background image size in jQuery? but they obviously don't apply here.