const subject = document.querySelector(".subject");
const timeline = new ViewTimeline({
subject,
axis: "block",
});
timeline.duration; // CSSUnitValue { value: 100, unit: "percent" }AnimationTimeline: duration property / notebook
AnimationTimeline: duration property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const timeline = new ScrollTimeline({
source: document.documentElement,
axis: "block",
});
timeline.duration; // CSSUnitValue { value: 100, unit: "percent" }document.timeline.duration; // null