jQuery: How can I check if a block in my document is inside the viewport or outside of it?

Posted by Jannis on Stack Overflow See other posts from Stack Overflow or by Jannis
Published on 2010-04-13T05:40:47Z Indexed on 2010/04/13 5:42 UTC
Read the original article Hit count: 436

Filed under:
|
|
|
|

I am basically trying to trigger a function if the footer is inside the viewport.

How can I check whether the footer is currently visible in the viewport?

I assume I will have to put it into the $(window).scroll() event so that the listener becomes true once the footer becomes visible but what the function should be I just can't figure out.

Any help would be much appreciated.

Thanks for reading,

Jannis

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about scroll