I want to animate a certain div in the DOM when the user scrolls to a certain height on the webpage, such as 600px.
Problem is, I’m looking through Google and I can’t find anything about it — it’s all about easing.
Can anyone help me with this? I’m looking at jQuery and Javascript documentations but still no dice.
Try this:
Note the timer here is important otherwise you could end up with literally thousands of
scrollevents being needlessly handled. The timer ensures the function runs once scrolling has ended.