Waiting for jQuery Animations: .promise(), .finish() and the Queue
Callback pyramids after fadeOut, logic that runs mid-animation, the queue backlog from impatient clicking - all solved by three methods most jQuery users never met.
Software Engineer
I build web applications and share what I learn along the way.
Step-by-step programming tutorials on PHP, JavaScript, Laravel, WordPress and more.
Callback pyramids after fadeOut, logic that runs mid-animation, the queue backlog from impatient clicking - all solved by three methods most jQuery users never met.
Elements appearing via display changes always snapped into place because there was no "before" state to transition from. Two new pieces of CSS fix entry AND exit animations.
animation-timeline: scroll() binds any CSS animation to scroll position - reading progress bars, parallax, scroll reveals - running off the main thread entirely.
document.startViewTransition snapshots your page, lets you mutate the DOM, and animates between the two states - list reorders and theme switches suddenly look expensive.
The Web Animations API runs keyframe animations from JavaScript with play, pause, reverse and a finished promise - no class juggling, no injected style tags.
Vestibular disorders make parallax and zoom animations physically unpleasant for a lot of people. Respecting the reduced-motion setting takes ten lines and is table stakes for professional work.
Gradients famously cannot be transitioned - until you teach the browser that your custom property is a color or angle. @property makes CSS variables animatable with types.