I am looking to re-tool my mobile web application to make use of Famo.us. It's all quite standard with scrollviews embedded in standard surfaces. If anyone could help me figure out how to transition between surfaces containing Scrollviews, I'd sincerely appreciate it.
So far I have a basic series of Scrollviews nested in surfaces and have them transitioning sequentially when clicked. It's based on the RenderController example included in the Famo.us examples Github repo.
var mainContext = Engine.createContext();
var renderController = new RenderController();
var surfaces = [];
var counter = 0;
var temp = [];
for (var i = 0; i < 10; i++) {
var scrollview = new Scrollview();
scrollview.sequenceFrom(temp);
for (var i = 0, temp; i < 40; i++) {
temp = new Surface({
content: "Surface: " + (i + 1),
size: [undefined, 200],
properties: {
backgroundColor: "hsl(" + (i * 360 / 40) + ", 100%, 50%)",
lineHeight: "200px",
textAlign: "center"
}
});
temp.pipe(scrollview);
}
surfaces.push(scrollview);
}
renderController.show(surfaces[0]);
Engine.on("click", function() {
var next = (counter++ + 1) % surfaces.length;
this.show(surfaces[next]);
}.bind(renderController));
mainContext.add(new Modifier({origin: [.5, .5]})).add(renderController);
This results in nothing displayed on the screen bar the header (header is not included in this code example), if i add temp directly to the surfaces object after each iteration however, i get each element of the scrollview displayed individually as a separate surface and can transition between all 40.