SyntaxFix
Write A Post
Hire A Developer
Questions
Cross browser way of doing this is
var top = ($(window).scrollTop() || $("body").scrollTop());