滚动页面,然后再执行CSS3 动画
来源:互联网 发布:mac怎么连接打印机 编辑:程序博客网 时间:2024/05/22 15:14
<!doctype html><html><head><meta charset="utf-8"><title>动态CSS3动画</title><style>* {margin:0; border:0; padding:0;}body {width:100%; height:2000px;}#div1 {width:100px; height:100px; background-color:#000; position:relative;}.ani {animation:myfirst 2s linear forwards; -webkit-animation:myfirst 2s linear forwards;}@keyframes myfirst {from {left:0; top:0} to {left:400px; top:400px;}}@-webkit-keyframes myfirst {from {left:0; top:0} to {left:400px; top:400px;}}</style><script>window.onload = function (){<span style="white-space:pre"></span> <span style="white-space:pre"></span>window.onscroll = function (){<span style="white-space:pre"></span>//两种方法:1、通过style.cssText写入样式;2、通过className添加类。<span style="white-space:pre"></span>//document.getElementById("div1").style.cssText = "animation:myfirst 2s linear forwards; -webkit-animation:myfirst 2s linear forwards";<span style="white-space:pre"></span>document.getElementById("div1").className = "ani";<span style="white-space:pre"></span>}}</script></head><body><div id="div1"></div><script></script></body></html>
0 0
- 滚动页面,然后再执行CSS3 动画
- css3滚动条动画
- CSS3动画animation语音滚动
- CSS3动画实现背景滚动
- CSS3+JQUERY页面滚动特效代码
- jQuery和CSS3炫酷滚动页面内容元素动画特效
- 使用CSS3 will-change提高页面滚动、动画等渲染性能
- AOS – 另外一个独特的页面滚动动画库(CSS3)
- CSS3制作动画加载页面
- 用CSS3动画,让页面动起来
- 实现html页面及css3动画
- iOS UIScrollView滚动影响动画执行
- 如何让CSS3动画在执行完一遍后再次重新执行
- 前端-----滚动加载页面动画技巧
- 页面滚动时,动态添加css动画
- 页面滚动触发css动画效果
- 详解用CSS3制作圆形滚动进度条动画效果
- CSS3笔记:滚动、扭曲、旋转、翻转、动画练习整理
- 常用防反接电路
- Spring框架学习(二) 之 jar包
- Android系统中TouchEvent的传递流程以及相关函数返回值True和False对流程的影响
- 输入两个数,第一个数决定一个nXn的矩阵
- C语言结构体声明中冒号的使用(占位符) & C结构体的乱序初始化
- 滚动页面,然后再执行CSS3 动画
- keil4下同时用arm和51
- 【有图】android通过jdbc连接mysql(附文件)
- 当fscanf碰上nan
- String.valueOf(que[i]).getBytes()含义
- Tomcat的虚拟目录的创建步骤
- 插入数据获得主键,调用其他存储过程
- Majority Element
- 【poj1811】Miller_Rabin and Pollard_rho