famo.us - how to do loops, and callbacks using $timeline? -
are these functionalities built service somewhere? here's sample context:
html
<fa-modifier fa-opacity="opacitymod(testtimeline.get())">...
js
$scope.testtimeline = new transitionable(0); $scope.opacitymod = $testtimeline([ [0, 0, easing.inoutexpo], [1, 1] ]); $scope.testtimeline.set(1, { duration: 500, curver: 'easeinout' });
couldn't find these in docs or reading src. ideas had were:
- loops - setinterval or re-run animation on callback
- callback - settimeout @ same time testtimeline.set called same duration within same scope
ended doing callback on transitionable's 'set' , re-running function afterwards. here's sample:
function runloop(){ $scope.testtimeline.set(1, {duration:...,curve:...}, function() { $scope.testtimeline.set(0, {duration:....,curve....}, runloop); }); } runloop();
note runs loop again backwards. (i wanted affect). still open other solutions
Comments
Post a Comment