Add scroll-triggered animations

Scroll-triggered animations make your website more dynamic without placing a heavy burden on load times. They attract attention, improve the experience and make important elements stand out at the right time. In this article, I explain how to implement this technically well: lightweight, responsive and SEO-proof.

1. When scroll animations make sense

Use scroll animations to subtly highlight specific elements, such as:

  • USPs or statistics
  • CTA Blocks
  • Testimonials
  • Graphs or process steps
  • Portfolio items

Note: use animation functionally. Not overkill – but support your message.

2. What technique do you choose?

There are several ways to build scroll animations. The choice depends on your project size and tech stack.

Popular options:

  • AOS.js – Lightweight, easy to integrate
  • ScrollTrigger (GSAP) – More control, but heavier
  • Intersection Observer API – Native JavaScript, no external libraries required

For SEO-friendly sites, I usually prefer AOS.js or Intersection Observer.

3. Scroll animations with AOS.js (quick setup)

AOS (Animate On Scroll) is quick to add and works well without JavaScript knowledge.

Step 1: Add AOS

html
<!-- Head -->
<link href="https://cdn.jsdelivr.net/npm/aos@2.3.4/dist/aos.css" rel="stylesheet">
<!-- Footer -->
<script src="https://cdn.jsdelivr.net/npm/aos@2.3.4/dist/aos.js"></script>
<script>
  AOS.init();
</script>
Copy to Clipboard

Step 2: Add data-aos to your HTML elements

html
<div data-aos="fade-up">Inhoud die infade bij scrollen</div>
<div data-aos="zoom-in" data-aos-delay="200">Met vertraging</div>
Copy to Clipboard

You can vary with: fade, slide, zoom, flip, duration, delay, etc.

Aan de slag met SEO? Neem gerust contact op.

Senior SEO-specialist






    4. Scroll animations with Intersection Observer (native JS).

    For those who prefer to work without external scripts, the Intersection Observer API is a lightweight and flexible solution.

    Example:

    html
    <div class="fade-in">Tekst of afbeelding</div>
    <style>
    .fade-in {
      opacity: 0;
      transform: translateY(20px);
      transition: all 0.5s ease;
    }
    .fade-in.visible {
      opacity: 1;
      transform: translateY(0);
    }
    </style>
    <script>
    const observer = new IntersectionObserver((entries) => {
        entries.forEach(entry => {
          if(entry.isIntersecting) {
            entry.target.classList.add('visible');
          }
        });
    });
    document.querySelectorAll('.fade-in').forEach(el => observer.observe(el));
    </script>
    Copy to Clipboard

    Advantage: no dependencies, full control over behavior and styling.

    5. Best practices (for SEO, UX and performance).

    • Use animations only if they are functional
    • Add prefers-reduced-motion support for accessibility
    • Load JS and CSS async/defer whenever possible
    • Avoid animating large images or heavy DOM blocks
    • Test on mobile and low CPU (Lighthouse / DevTools)

    In conclusion

    Scroll-triggered animations make your site visually stronger – if properly deployed. Use them to guide attention, support interaction and give structure to content. With tools like AOS.js or native JavaScript, you can implement it quickly and efficiently.

    Senior SEO-specialist

    Ralf van Veen

    Senior SEO-specialist
    Five stars
    My clients give me a 5.0 on Google out of 85 reviews

    I have been working for 12 years as an independent SEO specialist for companies (in the Netherlands and abroad) that want to rank higher in Google in a sustainable manner. During this period I have consulted A-brands, set up large-scale international SEO campaigns and coached global development teams in the field of search engine optimization.

    With this broad experience within SEO, I have developed the SEO course and helped hundreds of companies with improved findability in Google in a sustainable and transparent way. For this you can consult my portfolio, references and collaborations.

    This article was originally published on 3 June 2025. The last update of this article was on 18 July 2025. The content of this page was written and approved by Ralf van Veen. Learn more about the creation of my articles in my editorial guidelines.