Add onresize event on window.