← All posts

Tutorials

Disable animations, parallax and autoplay — a calmer page

Parallax that jerks on every scroll. Carousels moving on their own. Video starting on autoplay. For some people that is just an annoyance, for others a real problem (vestibular disorders, fatigue). One rule quiets the motion on a page.

Three sources of motion

CSS rule — animations and scroll

*, *::before, *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
html { scroll-behavior: auto !important; }

We use 0.01ms rather than 0s on purpose: the animation still "happens", so page code listening for the animationend event still gets it and does not hang waiting. To the eye, the motion is gone.

JS rule — stop video autoplay

function stopVideos() {
  document.querySelectorAll('video').forEach(v => {
    v.removeAttribute('autoplay');
    if (!v.paused) v.pause();
  });
}
stopVideos();
new MutationObserver(stopVideos)
  .observe(document.body, { childList: true, subtree: true });

Better: respect the system "reduce motion"

Your operating system has a "reduce animations" setting. Pages should read it via prefers-reduced-motion — but many do not. If you turned that option on in your system, this rule simply enforces what the page failed to respect.

Pitfalls

See also

Install JustZix — and browse without the page dancing.

Rate this post

No ratings yet — be the first.

Try it yourself

Install JustZix and paste any snippet from this article. Two minutes from zero to a working rule across all your devices.

Get JustZix

Features · How it works · Examples · Use cases