Skip to content

Instantly share code, notes, and snippets.

@nilbus
Created May 22, 2010 21:11
Show Gist options
  • Save nilbus/410368 to your computer and use it in GitHub Desktop.
Save nilbus/410368 to your computer and use it in GitHub Desktop.
var HijaxDefaultAnimations = new Class({
initAnimations: function(hijaxMaster) {
this.hijaxMaster = hijaxMaster;
this.initOutAnimations();
},
hijaxMaster: undefined,
initOutAnimations: function() {
this.hijaxMaster.addEvent('animateOut', function() {
contents = $('content').getChildren();
// "this" here is not evaluated until inside the event handler -----------v
contents[0].get('reveal').addEvent('onComplete', this.doneAnimation.bind(this));
contents.each(function(e){e.get('reveal').dissolve({duration: 1000})});
}.bind(this));
},
doneAnimation: function() {
// Problem: this here refers to the Fx.Reveal object, instead of the hijaxMaster from initAnimations
this.hijaxMaster.callChain();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment