js 代码
-
- function getScrollTop() {
- var scrollPos = 0;
- if (typeof window.pageYOffset != 'undefined') {
- scrollPos = window.pageYOffset;
- }
- else if (typeof window.document.compatMode != 'undefined' &&
- window.document.compatMode != 'BackCompat') {
- scrollPos = window.document.documentElement.scrollTop;
- }
- else if (typeof window.document.body != 'undefined') {
- scrollPos = window.document.body.scrollTop;
- }
- return scrollPos;
- }
posted @
2010-10-24 15:57
从孑开始
阅读(
719)
评论()
编辑
收藏
举报