Recently, I've been contemplating the idea of adjusting my background image to move around a bit. It seems like a fancy concept and not too difficult to execute. However, I am facing an issue because my background image is currently set to cover (background-size:cover;).
Here are the CSS settings I have so far:
var pageElement = document.getElementById("page");
var curLeft = pageElement.style.left;
var newLeft = posIndex[current] * 10 ;
At this point, I only have access to the css setting for left. Is there a way to determine what 'cover' has done exactly? I would like to know if it has increased the height and width of the image by 20% or any other specific value, so that I can accurately adjust the image accordingly.
I suppose I could try to estimate with code or simply ignore it altogether, shifting the image based on width alone and trusting the rendering process to handle the rest.