Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The animation-timeline
CSS property specifies the timeline that is used to control the progress of an animation.
The timeline can be provided by the current position on a scrollbar, in which case it is referred to as a scrollbar timeline. The element that provides the scrollbar timeline can be specified in two ways:
- A named scroll timeline is one in which the element that will provide the scrollbar timeline is explicitly named, by applying the
scroll-timeline-name
property (or thescroll-timeline
shorthand property). The name is then associated with the element to animate using theanimation-timeline
property. - An anonymous scroll timeline is set using the
scroll()
functional notation, which indicates that the element providing the scroll timeline is an ancestor of the element to be animated. The ancestor can either be set as either the root element or the nearest ancestor that has a scroll bar in either axis.
Whether the scrollbar uses a scrollbar at the top/bottom or left/right of the element can also be specified. If the selected axis does not have a scrollbar the associated animation timeline will be inactive.
The animation timeline can also be set using the animation
shorthand property.