这个属性是实验性功能,目前仅 Chrome Canary (115以上)版本浏览器支持此特性,可以实现滚动鼠标滚轮滚动页面驱动动画效果。
示例代码
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum=1.0,minimum=1.0,user-scalable=0" /> <title>BFW NEW PAGE</title> <style> #square { background-color: deeppink; width: 100px; height: 100px; animation-name: rotateAnimation; animation-duration: 3s; animation-direction: alternate; animation-timeline: scroll(); position: fixed; } @keyframes rotateAnimation { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } #stretcher { height: 1200px; } </style> </head> <body> <div id="container"> <div id="square"></div> <div id="stretcher"></div> </div> </body> </html>
网友回复
新手如何使用yolo进行图像数据标注与图像识别?
threejs如何将glb三维模型减少面数和定点数粗糙一些减少文件体积大小?
在哪可以免费下载各国的武器飞机坦克航母舰艇导弹三维模型glb文件?
aistudio中build如何破解gemini的api模型调用免费使用?
python如何让红绿灯看懂两侧车流智能调节红绿灯?
python+faster_whisper如何实现实时开会录音并转成文字?
python如何调用微信本地的ocr进行图片文字提取?
有没有浏览器js就能离线运行支持mcp的ai模型?
c#如何调用gemini api实现文本描述来自动化操作电脑软件?
c#如何读取正在打开的word软件正在编辑的内容进行修改操作?