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.
我正在尝试根据视口和滚动来切换元素。
通过使用$(window).scroll(function()..我可以在用户滚动时触发一个事件,但是如何检查您是否滚动到顶部以隐藏元素?
$(window).scroll(function()..
在 IE 中,属性是
document.body.scrollTop
在基于标准的浏览器中,该属性是
window.pageYOffset
测试值 0 以隐藏您的元素。