/*获取滚动条信息{x: , y:}*/
function scrollPos() {
if (self.pageYOffset !== undefined) {
return {
x: self.pageXOffset,
y: self.pageYOffset
};
}
var d = document.documentElement||document.body;
return {
x: d.scrollLeft,
y: d.scrollTop
};
}
/*设置滚动条信息pos={x: , y:}*/
function setScrollPos(pos) {
var e = document.documentElement, b = document.body;
e.scrollLeft = b.scrollLeft = pos.x;
e.scrollTop = b.scrollTop = pos.y;
}
posted on 2010-04-19 16:18
汪杰 阅读(181)
评论(0) 编辑 收藏 引用