示例工程 36-scroll-animations

36-scroll-animations/demo-01-progress/README.md

markdown · 0.3 KB

运行:滚动进度条

点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。

# demo-01-progress

容器滚动进度条。

## 运行

直接打开 `index.html`,滚动面板。

## 观察

- `scroll-timeline-name` 给容器命名
- 子元素用 `animation-timeline` 引用
- 进度从 0 到 1,与滚动位置一一对应
- 不需要 JS scroll 监听