tags:

views:

151

answers:

2

I need know if element is on the sreen, or is it off the screen. How can I do that with jQuery ? For example if my element is out of screen it has attribute top: 3000px.

+2  A: 

I don't know what are you trying to do but probabily there's a better way to do it.

Anyhow, you can see the position of the element and compare with the window boundaries.

Check this links to see how to do it:

Alex
+2  A: 

$(window).height(); // returns height of browser viewport $(document).height(); // returns height of HTML document

If $(window).height(); is less than 3000px than your element is offscreen!

tvgemert
You also need to check the scroll position using $(window).scrollTop()
Shawn J. Goff