Jquery的$('html,body').animate({scrollTop: '0px'}, 800);});这个为什么可以实现滚动条返回顶部?scrollTop并非css属性啊?
1 回答
慕标琳琳
TA贡献1830条经验 获得超9个赞
scrollTop是一个html 元素的属性。
Element.scrollTop

补充:animate包含了style属性和一些非style属性,比如:scrollTop,scrollLeft 等。
In addition to style properties, some non-style properties such as scrollTop and scrollLeft, as well as custom properties, can be animated.
添加回答
举报
0/150
提交
取消
