Skip to content

Instantly share code, notes, and snippets.

@AndyLampert
Created August 7, 2015 02:56
Show Gist options
  • Save AndyLampert/0581c4daa2d84458c8f9 to your computer and use it in GitHub Desktop.
Save AndyLampert/0581c4daa2d84458c8f9 to your computer and use it in GitHub Desktop.
$(document).ready(function(){
function resizeDiv() {
var vph = ( $(window).height() - 150 ); // adjust this as needed
var screen_width = $(window).width();
if (screen_width > 1199) {
$('.element-to-resize').css({'height': vph + 'px'});
} else {
$('.element-to-resize').css({'height': '585px'}); // adjust this as needed
}
}
resizeDiv();
window.onresize = function(event) {
resizeDiv();
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment