scrollBy与scrollTo的区别与用法

xnum:向右滚动的像素   ynum:向下滚动的像素

scrollBy(xnum,ynum) 方法 是相对当前位子滚动的 

* scrollBy() 在老版本的浏览器里 只支持 window不支持 Document ,新版本的浏览器即支持 window 也支持 Document

scrollTo(xnum,ynum) 方法 是从原点 (0,0) 位子开始滚动的

 

posted @ 2018-11-29 09:24  墨恒  阅读(3235)  评论(0)    收藏  举报