Skip to content

Instantly share code, notes, and snippets.

@john45traver
john45traver / Scroll Container
Created May 17, 2014 02:43
Container on scroll
var Engine = require("famous/core/Engine");
var Surface = require("famous/core/Surface");
var Scrollview = require("famous/views/Scrollview");
var ContainerSurface = require('famous/surfaces/ContainerSurface');
var mainContext = Engine.createContext();
var scrollview = new Scrollview();
@john45traver
john45traver / scrollToPosition
Created May 12, 2014 23:46
Scrolls scrollview to position
var scrollToPosition = function (finalPos, transition) {
var lastPos = scroller.getPosition();
var transitionable = new Transitionable(lastPos);
var prerender = function () {
scroller.setVelocity(0);
scroller.setPosition(transitionable.get());
};
class JTTrueSizeSurface
@DEFAULT_OPTIONS = {}
JTTrueSizeSurface.prototype = Object.create(Surface.prototype)
JTTrueSizeSurface.prototype.constructor = JTTrueSizeSurface
constructor: (id) ->
@id = id
Surface.apply(this, arguments)
@size = this.getSize()