Add event handler of window resize.