body is jumping up and down after snapping to a point
Well, I tried many combination of the function, but still, after im scrolling to some snap point it jumps up and down without stopping. any help with that?
can you provide more infos: which browser(s), what settings of the plugin, ... ?
On 18 June 2014 04:21, amitmoreno [email protected] wrote:
Well, I tried many combination of the function, but still, after im scrolling to some snap point it jumps up and down without stopping. any help with that?
— Reply to this email directly or view it on GitHub https://github.com/benoitpointet/jquery-scrollsnap-plugin/issues/19.
Liip FR +41 26 422 2511 http://liip.ch
I'm experiencing a similar issue with horizontal scrolling, but ONLY if zoom is set to negative (ie. -90%). It will constantly jump/jitter at any snap point. It happens in all browsers I've tested, and have isolated it to your code by process of elimination. If I find a code solution I will post back.
edit: It seems to be a problem with the offset of the matchingEl and the scrollingEl. For some reason unknown to me it detects a 1.6px difference in offset despite each scroll. So i've implemented a tolerance of +/-3px to the if statement so if its in that range it does not scroll. Super hacky, hopefully someone works out why this happens on zoom out.
i had to implement a tolerance as well. this only happened on an ipad.
It seems to be caused by some number rounding or similar things. Changing line 121 from if ($scrollingElscrollLT != endScroll) { to if ($scrollingElscrollLT != endScroll && Math.abs($scrollingElscrollLT - endScroll)>2) { works for me. Added condition tells that snapping would be ignored if distance is less than 2px. Similar code on line 80 might need to be changed same way too.
Correction: In my previous post the first condition is now redundant so if (Math.abs($scrollingElscrollLT - endScroll)>2) { is better.
Thanks will integrate that code.
fixed in commit https://github.com/benoitpointet/jquery-scrollsnap-plugin/commit/c7fd6e789aa7bcc6aef3dd5c6b75ed4c74ff92de