How to check if an element is really visible with javascript.

Posted by Macha on Stack Overflow See other posts from Stack Overflow or by Macha
Published on 2009-04-01T09:28:46Z Indexed on 2010/05/17 6:40 UTC
Read the original article Hit count: 217

Filed under:
|
|

In javascript, how would you check if an object is actually visible. I don't just mean checking the visibility and display attributes. I mean, checking that the element is not

  • visibility:hidden or display:none
  • underneath another element
  • scrolled off the edge of the screen.

EDIT: For technical reasons, I can't include any scripts. I can however use prototype as it is on the page already.

EDIT 2: This is no longer neccesary, but I'd still find an answer interesting)

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about visibility