I would like to call functions when the browser window goes beyond a certain point
(e.g the user scrolled the window down beyond 200px from the top
Is there an e
A popular plugin for what you're describing is jQuery Waypoints.
If you don't wish to use a plugin, the mechanisms are:
$(window).scrollTop(); // returns pixel value
$(window).scroll(function () { /* code here */ });
However, because the scroll
event fires very quickly, you must be careful to put only code that executes quickly inside the handler. A common technique is to "throttle" the rate at which you handle the event by checking if a certain amount of time has passed.