Skip to content

Instantly share code, notes, and snippets.

@willmorgan
Created November 6, 2013 13:38
Show Gist options
  • Save willmorgan/7336191 to your computer and use it in GitHub Desktop.
Save willmorgan/7336191 to your computer and use it in GitHub Desktop.
transitionmasher.js
if(this.transitions) {
body.addClass('bhv-transition-now').css('height', fullHeight);
body.height();
body.removeClass('bhv-transition-now').addClass('state-transitioning');
body.height();
body.css('height', 0);
body.on('transitionend.close', function(event) {
body.off('transitionend.close');
body.addClass('state-hidden');
body.height();
body.removeClass('state-transitioning');
body.height();
body.removeAttr('style');
});
}
@willmorgan
Copy link
Author

Reading the DOM with body.height() causes a repaint to happen, and consolidates all class switching changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment