Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Customizing Anchor Placement | Core AOS Features
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
HTML Scroll Animations with AOS

bookCustomizing Anchor Placement

When working with AOS, you can fine-tune exactly when an animation starts as you scroll by using the data-aos-anchor-placement attribute. This attribute determines which part of the animated element should align with which part of the viewport before the animation is triggered. By default, AOS triggers an animation when the top of the element reaches the bottom of the viewport, but you can change this behavior for more control.

The data-aos-anchor-placement attribute takes values in the format "element-part-viewport-part", where:

  • "element-part" can be one of: top, center, or bottom;
  • "viewport-part" can be one of: top, center, or bottom.

Here are some common anchor placement options and their effects:

  • "top-bottom": Animation triggers when the top of the element touches the bottom of the viewport;
  • "center-bottom": Animation triggers when the center of the element touches the bottom of the viewport;
  • "bottom-bottom": Animation triggers when the bottom of the element touches the bottom of the viewport;
  • "top-center": Animation triggers when the top of the element reaches the center of the viewport.

By adjusting this attribute, you can control the exact scroll position that starts the animation, allowing for more precise timing and a better user experience. This is especially useful if you want animations to occur earlier or later as the user scrolls through your page.

question mark

What does the data-aos-anchor-placement attribute control?

Select the correct answer

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 5

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

Suggested prompts:

Can you give examples of how to use different `data-aos-anchor-placement` values?

What are some best practices for choosing anchor placements in AOS?

How does changing the anchor placement affect the animation timing?

bookCustomizing Anchor Placement

Desliza para mostrar el menú

When working with AOS, you can fine-tune exactly when an animation starts as you scroll by using the data-aos-anchor-placement attribute. This attribute determines which part of the animated element should align with which part of the viewport before the animation is triggered. By default, AOS triggers an animation when the top of the element reaches the bottom of the viewport, but you can change this behavior for more control.

The data-aos-anchor-placement attribute takes values in the format "element-part-viewport-part", where:

  • "element-part" can be one of: top, center, or bottom;
  • "viewport-part" can be one of: top, center, or bottom.

Here are some common anchor placement options and their effects:

  • "top-bottom": Animation triggers when the top of the element touches the bottom of the viewport;
  • "center-bottom": Animation triggers when the center of the element touches the bottom of the viewport;
  • "bottom-bottom": Animation triggers when the bottom of the element touches the bottom of the viewport;
  • "top-center": Animation triggers when the top of the element reaches the center of the viewport.

By adjusting this attribute, you can control the exact scroll position that starts the animation, allowing for more precise timing and a better user experience. This is especially useful if you want animations to occur earlier or later as the user scrolls through your page.

question mark

What does the data-aos-anchor-placement attribute control?

Select the correct answer

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 5
some-alt