3

I have a div on a page, rather than populate it when the page loads, I'd like to defer the call until the point at which it is within view. In many cases the user will have to scroll down to see it, and If they never view that portion of the page I'd like to not have to spend the resources to query and display that information. Is there a way using jquery to determine that an element has come into view, and trigger an ajax call at that point?

Jeremy
  • 40,978
  • 63
  • 191
  • 304
  • better than plugin http://stackoverflow.com/questions/487073/check-if-element-is-visible-after-scrolling – SkyPunch Jan 15 '13 at 11:36

1 Answers1

7

Look into the jQuery Waypoints plugin.

You can use it to detect when an element reaches the bottom of the page view and fire a function on that event.

Purag
  • 16,273
  • 4
  • 48
  • 70
  • Hey @Jeremy--it always helps to accept answers if they've helped you out. If my answer solved your problem, you should accept it; but by all means, you can wait for more answers. :) – Purag Aug 31 '12 at 20:48