怎样让元素节点滚动到特定位置

元素节点的滚动有三种方法: 

1. Element.scrollTop, 表示滚动到距离顶部多少像素

2. Element.scrollLeft, 表示滚动到距离左边多少像素

3. Element.scrollIntoView() 表示滚动到和页面的可视区域, 即视口, 和锚点定位类似. 

猜你喜欢

转载自www.cnblogs.com/aisowe/p/11712568.html
今日推荐