JavaScript Animations
显式调用动画函数
CSS3 Animations
通过切换Class控制状态
http://jsbin.com/remako/edit?js,console,output
常见需求:方块下移400像素,时长1秒
http://jsbin.com/lisixe/edit?js,console,output
requestAnimationFrame
http://jsbin.com/dakehe/edit?html,js,console,output
浏览器可以优化并行的动画动作,更合理的重新排列动作序列,并把能够合并的动作放在一个渲染周期内完成,从而呈现出更流畅的动画效果。
利用绝对定位与background-position
.css3 .sec1 .typing-4 {
visibility: visible;
animation: typing-4 0.5s steps(4,end);
-webkit-animation: typing-4 0.5s steps(4,end);
}
@keyframes typing-4 {
from {width:0;}
}
@-webkit-keyframes typing-4 {
from {width:0;}
}
http://designmodo.com/demo/stepscss/index.html
设计稿按全屏做 1366*768、1920*1080
任务栏、菜单栏等占据一定高度
浏览器视口高度为屏幕高度减少100~200像素
提前沟通,防止内容区溢出