Skip to content

Instantly share code, notes, and snippets.

@pathawks
Created March 17, 2014 13:51
Show Gist options
  • Select an option

  • Save pathawks/9599506 to your computer and use it in GitHub Desktop.

Select an option

Save pathawks/9599506 to your computer and use it in GitHub Desktop.
GPU Accelerated Slides in jQuery
jQuery.fn['slideToggle'] = function( speed, easing, callback ) {
if (jQuery(this).height()) {
jQuery(this).css('transition', 'all .3s').css('overflow','hidden').css('height','0');
} else {
jQuery(this).css('transition', 'all .3s').css('overflow','hidden').css('height',jQuery(this).prop('scrollHeight')+'px');
}
};
jQuery.fn['slideUp'] = function( speed, easing, callback ) {
jQuery(this).css('transition', 'all .3s').css('overflow','hidden').css('height','0');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment