window.onresize = function resizing() { wWidth=$(window).width(); wHeight=$(window).height(); $('.onDiv').css('height',wHeight+'px'); $('.onDiv').css('width',wWidth+'px'); }