Skip to content

Commit

Permalink
removed prefix from Scroller for the time being
Browse files Browse the repository at this point in the history
  • Loading branch information
pbakaus committed Sep 22, 2011
1 parent 95a39d2 commit 275413e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 46 deletions.
37 changes: 1 addition & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,39 +88,4 @@ To zoom using the `mousewheel` event just pass the data like this:

* `doMouseZoom(e.wheelDelta, e.timeStamp, e.pageX, e.pageY);`

For more information about this please take a look at the demos.


Zynga Animate
=============

The Zynga Scroller uses our Zynga Animate class. This class uses requestAnimationFrame (or an automatic polyfill).

Features
--------

* Automatic dropped frame handling
* Frames per second are computed (and returned on complete event). Target frame rate is 60.
* Animations with duration or infinite animations
* Custom easing methods are supported
* Callbacks for:
* each step (containing the current percent position)
* completion (with reached frame rate and info about whether the animation was completed)
* validation to continue animation (useful for endless animations)
* The animation can be cancelled by the ID returned by calling start()

Usage
-----

* Start an animation:
`zynga.Animate.start(stepCallback, verifyCallback?, completedCallback?, duration?, easingMethod?, root?) => animationId`
* stepCallback: Executed on every step
* verifyCallback(id): Executed before each animation step
* completedCallback(fps, id, finished): Executed when animation is completed
* duration: Milliseconds to run the animation
* easingMethod: Function reference to use for easing
* root: Root element of animation
* Stop an animation:
`zynga.Animate.stop(animationId)`
* Querying whether an animation is running:
`zynga.Animate.isRunning(animationId) => bool`
For more information about this please take a look at the demos.
2 changes: 1 addition & 1 deletion demo/dom-paging-x.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@


// Initialize Scroller
var scroller = new zynga.Scroller(render, {
var scroller = new Scroller(render, {
scrollingY: false,
paging: true
});
Expand Down
2 changes: 1 addition & 1 deletion demo/dom-paging-y.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@


// Initialize Scroller
var scroller = new zynga.Scroller(render, {
var scroller = new Scroller(render, {
scrollingX: false,
paging: true
});
Expand Down
2 changes: 1 addition & 1 deletion demo/dom-snapping.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
}

// Initialize Scroller
var scroller = new zynga.Scroller(render, {
var scroller = new Scroller(render, {
snapping: true
});

Expand Down
2 changes: 1 addition & 1 deletion demo/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var clientWidth = 0;
var clientHeight = 0;

// Initialize Scroller
this.scroller = new zynga.Scroller(function(left, top, zoom) {
this.scroller = new Scroller(function(left, top, zoom) {
render(left, top, zoom);

document.getElementById("scrollLeft").value = left.toFixed(2);
Expand Down
9 changes: 3 additions & 6 deletions src/Scroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@
==================================================================================================
*/

if (!window.zynga) {
zynga = {};
}

var Scroller;
(function() {

/**
* A pure logic 'component' for 'virtual' scrolling/zooming.
*/
zynga.Scroller = function(callback, options) {
Scroller = function(callback, options) {

this.__callback = callback;

Expand Down Expand Up @@ -1064,7 +1061,7 @@ if (!window.zynga) {

// Copy over members to prototype
for (var key in members) {
zynga.Scroller.prototype[key] = members[key];
Scroller.prototype[key] = members[key];
}

})();

0 comments on commit 275413e

Please sign in to comment.