Closed ranmacar closed 9 years ago
Hi,
First of all, which version of famous-flex are you using? I'm asking because v0.3 now returns the absolute scrollOffset in the events. The scrollOffset is in pixels btw, not percentage. If you want to convert it into percentage, you could wrap it in a 'SizeAwareView' in order the width/height and convert scrollOffset to a percentage.
cheers
Thanks for the quick response,
I am using the 0.3. Noticed the scrollOffset is in pixels, but didn't quite understand what it represents. What I'd want to achieve is a centered scrollView, which starts with the middle-ish element in the middle, at which point the calculated offset is 0.5. And by scrolling to the sides it varies between 0 on the left and 1 on the right.
Works now, with scrollView.scroll(scrollViewSize/2) and onScroll with the calculation relative = (e.scrollOffset) / (scrollViewSize - e.size[0])
Hello,
I am trying to determine my scroll position on a scale from 0-1. Have trouble understanding what the scrollOffset value in the event represents. Thought it goes from 0 to negative container width, but seems its not that simple.
Is there a simple way to get the scroll position in this range?
Thanks!