Hey all,

I've been trying to figure out how to trigger a function after a user
stops scrolling. I was considering a time delay, but that doesn't seem
to make sense for what I'm using this for (a long page of links).

Here's a basic example of what I've got now:

$(document).scroll(function(){
  myFunction();
});

myFunction is a function I've written to animate a div on my page to
slide back into the viewport when a user scrolls down the page.

Nothing very complex, but as I said, I'd like to execute this function
a few seconds after a user stops scrolling (in hopes of preserving a
smooth animation and minimizing the times my function is executed). I
was thinking of putting in a simple time delay, but I suspect this
would not work over several pages of varying lengths.

Anyone have any suggestions? I tried looking around google for
something similar without much success.

Reply via email to