在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/網(wǎng)絡(luò)安全  HTML/ JQuery的animate設(shè)置{scrollTop: '0px'}為何可以實(shí)現(xiàn)

JQuery的animate設(shè)置{scrollTop: '0px'}為何可以實(shí)現(xiàn)返回頂部,scrollTop并非css屬性???

Jquery的$('html,body').animate({scrollTop: '0px'}, 800);});
這個為什么可以實(shí)現(xiàn)滾動條返回頂部?
scrollTop并非css屬性???

回答
編輯回答
孤巷

scrollTop是一個html 元素的屬性。
Element.scrollTop

clipboard.png

補(bǔ)充:
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.

jQuery.animate

2018年3月10日 04:51