$(window) -> $(document) because of jQuery 1.9