-
Notifications
You must be signed in to change notification settings - Fork 0
Frame.js
Danny Garcia edited this page Sep 29, 2012
·
2 revisions
Frame.js is a simple polyfill for window.requestAnimationFrame
.
// Standard
(function () {
var frame = new fil.Frame();
frame.start(); // starts requestAnimationFrame
// Animation Frame
frame.step = function (f) {
// Do cool things with animations here.
};
window.setTimeout(function () {
frame.stop(); // stops requestAnimationFrame
}, 5000);
}());
// AMD
require(["Frame"], function (Frame) {
var frame = new fil.Frame();
frame.start(); // starts requestAnimationFrame
// Animation Frame
frame.step = function (f) {
// Do cool things with animations here.
};
window.setTimeout(function () {
frame.stop(); // stops requestAnimationFrame
}, 5000);
});