IE:
对于没有doctype声明的页面,使用 document.body.scrollTop 或 document.documentElement.scrollTop;
对于有doctype声明的页面,则使用 document.documentElement.scrollTop;
Chrome、Firefox:
对于没有doctype声明的页面,使用 document.body.scrollTop 来获取 scrollTop高度 ;
对于有doctype声明的页面,则使用 document.documentElement.scrollTop;
Safari:
safari 有自己获取scrollTop的函数 : window.pageYOffset ;
为解决兼容性问题,应封装一个函数