garand / sticky

jQuery Plugin for Sticky Objects
Other
3.3k stars 1.06k forks source link

flickering when scrolling on iOS safari #187

Open raistie opened 8 years ago

raistie commented 8 years ago

as above. it disappears and appears again rather than being a smooth sticky

ncrcat commented 8 years ago

I experienced this issue on iOS 7. The best solution I could find was to add a "touchmove" event

window.addEventListener('touchmove', scroller, false);
Dannymx commented 8 years ago

@ncrcat Could you explain more about this? I added the line but nothing changed.

ncrcat commented 8 years ago

Hi @Dannymx , sure, please have a look at https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html

The problem is that onMouseMove and onScroll fire only after the user finishes the gesture of scrolling

ananaszjoe commented 8 years ago

Mine flickered on iOS as well, because the .sticky-wrapper element had a custom CSS rule that set its height to auto (which is a no-no).