HTML how to tell which elements are visible?

前端 未结 2 1013
遥遥无期
遥遥无期 2020-12-18 03:23

I have seen several solutions which determine when an element is visible in the viewport whilst scrolling the page, but I haven\'t seen any which do this for elements that a

2条回答
  •  渐次进展
    2020-12-18 04:11

    http://www.quirksmode.org/mobile/viewports.html discusses the issues around viewports, determining their dimensions, and calculating element bounds relative to a viewport's coordinate frame. Part 2 of that blog post then goes into the implicit viewports in mobile browsers. He doesn't give code that answers your question exactly, but it's definitely relevant and worth a read.

提交回复
热议问题