Ionic scroll, getScrollPosition() doesn't get the new coordinates, how to?


#1

`

`

$scope.onScroll = function () { console.log($ionicScrollDelegate.getScrollPosition()); };

i get Object {left: 0, top: 0, zoom: 1}

any ideas how to get the actual position?


#2

Use delegate-handle attribute on ion-scroll so that with ionicScrollDelegate you know exactly which scrolling element are you selecting.
See example:


Scroll stop event
#3

thanks,

is there a way to know when the scroll stopped? so i can grab the last position values?


#4

I’ve changed the codepen example a little bit to include timeout which will trigger when the scroll ends.
Unfortunately in Javascript there is no scroll end event and I guess timeout is the good option.


#5

thanks for the update


#6

that way I can see in real time where this position because I have a transparent header and when it reaches 100 should change color to red, as I can do that?