document.body.scrollTop is always 0 in IE even when scrolling

You may want to try this for an older doctype in IE:

var top = (document.documentElement && document.documentElement.scrollTop) || 
              document.body.scrollTop;

Leave a Comment