$(window).scrollTop();
$(window).scrollLeft();

would be more effective here, in my case when using 'body' it was being told the scrollTop was 0 when it wasn't, changing to window fixed this.