Created
February 29, 2012 03:13
-
-
Save stuffness/1937288 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
animation = { | |
amount: 20, | |
ready: true, | |
anim: function(dir, el) { | |
amount = dir * this.amount; | |
if (this.ready) { | |
this.ready = false; | |
el.animate({ | |
left: '+=' + amount, | |
top: '+=' + amount | |
}, function() { | |
this.ready = true; // this seems to be out of scope.. | |
// how can I set the 'ready' property of 'animation' | |
// in this callback function? | |
}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment