Skip to content

Instantly share code, notes, and snippets.

@AlexJWayne
Last active August 3, 2016 19:19
Show Gist options
  • Save AlexJWayne/88f391457441dd8065c71726e95bb2f4 to your computer and use it in GitHub Desktop.
Save AlexJWayne/88f391457441dd8065c71726e95bb2f4 to your computer and use it in GitHub Desktop.
var resize_interval;
// resize AFTER resize finished, and don't do again for a second or so
window.onresize=function(){
// Window was resized, so cancel any previous deferred resize handlers.
clearTimeout(resize_interval);
// Call this every 750ms
resize_interval = setTimeout(function () {
// Do the crap you need to do on resize.
$('body').css('min-height',$(window).height()+'px');
if ($.isFunction(jQuery.fn.body_height)) {
$('div.body_height').body_height();
}
}, 750);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment