Sorry, still have a little issue:
If I "throw" the content to the left and resize the window to > 768px the two images are shifted to the left (since the inline style still remains). You can reproduce that behavior in my codepen above.
I know customers usually don't resize their browser window back and forth but unfortunately there are some devices (like iPhone X) that exceed the 768px viewport width in landscape.
I fixed this very simply by resetting the transform property on window resize:
window.onresize = function () {
document.querySelector($content).style.transform = 'translate3d(0px, 0px, 0px)'
};
However now I have a different strange behavior: if I turn the screen back into portrait I'm able to dragged the content out of the container (see gif below). Looking at the properties in the dev tools I see that the transform property after dragging to the left is set to:
translate3d(-594px, 0px, 0px);
The maximum (and/or minimum) value should be translate3d(-279px, 0px, 0px) in case of the iPhone X.
Did I do something wrong by setting the transform-value on window resize? Is there a better (and waterproof) solution how to handle this?
Thanks so much!