$(window).load(function(){ var $this = $("#panel_feature .panel_inner"); if ($this.height() > 720){ $this.css("min-height", "970px"); } else if ($this.height() > 470){ $this.css("min-height", "720px"); } });