I have a div with a background image of a world map that I need to clip at two precise points. Clipping from the left side is straightforward.
In my CSS:
.le-map {
background-image: url('../img/le-map-of-le-world.mlg');
background-size: 100%;
background-repeat: no-repeat;
}
And in JavaScript:
var clipLeft = [Number of pixels from the left edge of the image where cropping should start]
$leMap.css({ background-position: -(clipX)}
I set the div to display the map as its background image, then move the image to the left by the specified number of pixels. Now, I also need to crop it from the right side at another specific point, which will be stored in a JavaScript variable. Is this achievable?
Thank you! --Gaweyne