infiniteScroll, and the user scrolls 'too fast', the if statement triggers again before carousel.scrollLeft() has updated, causing the carousel.scrollLeft() to get overwritten. carousel.scrollLeft(), where we can see that it 'teleports' back and forth a couple of times, causing it to get stuck.