Skip to content

Instantly share code, notes, and snippets.

@stuffness
Created February 29, 2012 03:13
Show Gist options
  • Save stuffness/1937288 to your computer and use it in GitHub Desktop.
Save stuffness/1937288 to your computer and use it in GitHub Desktop.
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