Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想获取文档的位置并使用 jQuery scrollTop() 在 px 中的控制台中显示它
应该只是:
console.log(jQuery(document).scrollTop());
您必须计算滚动条到顶点的距离。
http://jsfiddle.net/6hcE7/1/
var scrollTop = $(window).scrollTop();