Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Cool vertical parallax page scroll effect. Re: Cool vertical parallax page scroll effect.

#104665
DrCLue
Member

If one’s event driven Javascript animations exhibit jerkiness, it’s often a good idea to de-couple the events from the animation routine itself.

Have the event handler simply store the values and do no actual animation itself

Have a separate interval pumped function read those values periodically and perform whatever animation.

Often the issue is that events occur too quickly to be properly serviced (event overrun) and frequently the difference between one event’s values and the next are not really worth servicing anyways.

If one has a situation where events come too fast AND the values may change a great deal, it’s still a good idea to decouple , but just have the interval function incrementally
walk towards the values which has a smoothing effect.