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.
我正在尝试查看屏幕上可以看到哪个 span 元素或最接近它的上方,我不确定如何实现这一点。该页面将是可滚动的,并且跨度将是可见的。屏幕上是否有可见的选择器?
猜猜,你应该比较 window.scrollTop() 和你的元素 scrollTop 值。PS不要忘记包括元素高度