0

I have a scrollview, then I tried this

scrollview.sync.on('start',function(e){ 
 console.log("started!")
});

But it's not working, do I need to do something else?

user3491456
  • 327
  • 1
  • 3
  • 11

1 Answers1

0

The code you posted looks correct.

Here is the full example where the start event is working. Hope it helps!

var Engine          = require('famous/core/Engine');
var Surface         = require('famous/core/Surface');
var Transform       = require('famous/core/Transform');
var Scrollview      = require('famous/views/Scrollview');

var context = Engine.createContext();

var scrollview = new Scrollview();
var surfaces = [];

scrollview.sequenceFrom(surfaces);

for (var i = 0; i < 40; i++) {
    var surface = new Surface({
         content: "Surface: " + (i + 1),
         size: [undefined, 200],
         properties: {
             backgroundColor: "hsl(" + (i * 360 / 40) + ", 100%, 50%)",
             lineHeight: "200px",
             textAlign: "center"
         }
    });

    surface.pipe(scrollview);
    surfaces.push(surface);
}

scrollview.sync.on('start',function(e){
    console.log("Start!");
});

context.add(scrollview);
johntraver
  • 3,612
  • 18
  • 17