$(window).resize(function() { var win_width = $(window).width(); var win_height = $(window).height(); console.log(win_width); console.log(win_height);});