0

Searching on the web, I only come across solutions that take into account the viewport and/or the first parent container which is scrollable. But, is there a bulletproof way to check if a div is visible (the user can actually see it, part of it or whole) even if it's inside of an arbitrary number of scrollable components, or there are other components that are on top of this div overlapping it, or div has display: none, or any other case I cannot think of right now ?

but-why
  • 433
  • 8

1 Answers1

0

Perhaps this answer would help you. The author creates a utility function that logs visibility for an element to the console.

thomasbishop
  • 49
  • 1
  • 6