performance - jQuery debounced slideshow skips slides

问题描述:

I have written a plugin for my personal homepage, which is supposed to scroll through a series of elements, snapping to each elements offsetTop.

I am using requestanimationframe to debounce the scrolling events but sometimes slides are being skipped and I just can't figure why. Additionally on Chrome and Safari I have the problem that window.pageYOffset can be smaller than 0 and bigger than document hight because of some kind of easing those browsers are using on mac (with the touchpad) – how would you handle that?