I need to animate a layer determined by other layer's scrollY. but I think there's delay on returning value when I scroll fast on mobile (desktop's fine). Is there a way that I can get scrollY without delay?
how long is the delay? can you put together a codepen?
Andreas Wahlström it's about 1 sec or so. will do shortly.
no apparent delay here. device related? i'm on iphone 5s
Andreas Wahlström no, when you drag far / fast enough, you can see "0" is displayed with delay. guess it's related with bounce scrolling of iOS, but not sure. :-(
oh right. iOS only gives you a scrollevent when the page stops scrolling. the scrollY is really a dragY workaround, if I'm not mistaken. that's why it's not giving you any event feedback when it bounces back. I think the delay is fixed, so you can probably estimate the scrollY value yourself based on where you dropped the layer.
Andreas Wahlström oh I see, will try workaround based on your idea. and I remember koen made another scrollview, have to check that out too. Thanks man!
let us know how it goes :)
Yeah iOS doesn't give scroll events until touchup for perf reasons. My custom scrollview does.
Koen yep, just did my workaround :-) will try your scrollview too. Will share when I'm ready to. Thanks guys!