Domanda

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.

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top