这个属性是实验性功能,目前仅 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>
网友回复
有没有抓取抖音头条等自媒体平台指定主题的评论的python开源程序?
css如何实现多个代码块向下滚动右上角复制按钮sticky粘性在顶部效果?
python+Quill如何实现多人实时文档编辑html?
什么是ai的6A工作流规则?
&、nohup、screen、tmux在linux中后台执行的区别?
python如何将调用ai大模型生成的文件修改行操作指令修改原文件后保存?
python如何将2d平面线图转换成数字2d线稿图?
acejs代码编辑器如何调用openai api实现选择代码修改与代码自动补全?
ace.js如何获取选择文本的开始和结束行数?
如何把qwen code cli或gemini cli的免费调用额度换成http api对外开放接口?