I've recreated a very stripped back version of what I'm doing here:
html:
<div class="placeholder"></div>
css:
html,
body {
width: 100%;
height: 100%;
}
.placeholder {
width: 300%;
height: 100%;
background: rgba(0,0,0,0.2);
}
js:
$(function() {
$.backstretch(
[
'http://lorempixel.com/1000/1000/',
'http://lorempixel.com/1200/1000/',
'http://lorempixel.com/1000/1200/'
]
);
$.backstretch("pause");
$(window).scroll(function (e) {
if ($(window).scrollLeft() > 250) {
$.backstretch("next");
}
});
});
When you scroll horizontally past 250px it (sometimes) jumps the scrollbar left back to the start when the backstretch image changes. You may have to try it a few times before it happens.
Can anyone tell me why and how I might prevent this from happening?