1

What would be the the best way to get the current view/page in paginated scrollview?

There are only gotonextpage and gotoprevious page methods in scrollview. I know I have some data at hand on scrollview.sync.on('end') event, but that looks like I need to calculate my self the current view/page somehow. (like the Shine demo with scroller)

There must be some easier approach I haven't spotted.

  • What's your question? – Mansueli Jun 02 '14 at 20:57
  • Returns the position associated with the Scrollview instance's current node (generally the node currently at the top). Scrollview.prototype.getPosition = function getPosition() { return this._particle.getPosition1D(); – aintnorest Jun 19 '14 at 04:59

1 Answers1

0

in coffeescript:

coverView.on 'pageChange', (e) -> 
  p = coverView.getPosition()   # some weird value
  n = coverView._node.index
  console.log('coverView', e, n, p)

however, this only seems to work in one direction :)

https://github.com/Famous/views/issues/67

dcsan
  • 11,333
  • 15
  • 77
  • 118
  • This was something i was looking for. The direction bug is still present though. I used the fix as described in the issue 67. – user3700765 Jul 08 '14 at 17:32