$(window).on("load scroll resize",function(e){ var a = ($(window).height() - 389; $('#blue').css({'min-height':a+'px'}); })