Added the positioning method to the window resize event.