document.documentElement.scrollTop

//当前位置向下滚动100px

//

不同chrome版本可能适用的不同有的是
document.documentElement.scrollTop
而有的是
document.body.scrollTop
 
window.scroll(0,parseInt(document.documentElement.scrollTop) ? parseInt(document.documentElement.scrollTop):parseInt(document.body.scrollTop)+100)

参考链接:

http://blog.haoji.me/document-body-scrolltop-is-zero.html  

猜你喜欢

转载自www.cnblogs.com/cbugs/p/12675494.html