Minor refactor for unnecessarily repeated $(document) $(window) and $('body')
$(document)
$(window)
$('body')