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.
我有一个包含 HTML 内容的 Iframe,每个行集都有一个 div。我想根据移动的滚动捕获 Iframe 视图中第一行的 div id。
您可以使用滚动偏移(document.body.scrollTop)结合elementFromPoint(x,y)
document.body.scrollTop
elementFromPoint(x,y)
document.elementFromPoint