Wrong use of $(window).resize() (deleted) inside resizeWindow()