😄animation-timeline có phải nó làm việc với thanh cuộn (ok)
Example 1.1
Example 1 này rất quan trọng để hiểu chúng ta sử dụng đún thanh cuộn https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timeline/scroll
/* Function with no parameters set */
animation-timeline: scroll();
/* Values for selecting the scroller element */
animation-timeline: scroll(nearest); /* Default */
animation-timeline: scroll(root);
animation-timeline: scroll(self);
/* Values for selecting the axis */
animation-timeline: scroll(block); /* Default */
animation-timeline: scroll(inline);
animation-timeline: scroll(y);
animation-timeline: scroll(x);
/* Examples that specify scroller and axis */
animation-timeline: scroll(block nearest); /* Default */
animation-timeline: scroll(inline root);
animation-timeline: scroll(x self);
Sử dụng thuộc tính animation-timeline: scroll(block root); có nghĩa là sử dụng thanh cuộn của thẻ body 🤡 còn nếu không sử dụng thì nó sẽ sử dụng animation-timeline: scroll(nearest); /* Default */
Example 1.1 hoặc chúng ta có thể sử dụng cách đặt tên như này

Khi html, body cuộn nó sẽ tác động tới box__left-psucenter
Example 2


Tóm tắt bài viết https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timeline#examples
PreviousDifference between animation and transition in CSSNextTừ bài animation-timeline làm việc với thanh cuộn tìm ra cách sử dụng background-clip: text;
Last updated
Was this helpful?