HTML前端开发之路--Animation_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 08:57:22
Original
1196 people have browsed it

Animation和transition一样也是动画效果,但是transition只能控制动画开始的起始状态,而Animation可以设置关键帧去定义动画的过渡过程;

Animation用@keyframes去自定义一个变化过程  {}内部包含着动画变化的关键帧例如:

@-webkit-keyframes mycolor {<br />    0%{<br />        background-color: brown;<br />    }<br />    40%{<br />        background-color: aqua;<br />    }<br />    70%{<br />        background-color: #555555;<br />    }<br />    100%{<br />        background-color: brown;<br />    }<br /> }
Copy after login

然后再根据相应的动作触发动画过程,比如hover,active等,animation和transition一样有三个子属性值,property,duration和timing-function

另外提一下,timing-function有5个值,linear,ease,ease-in,ease-out,ease-in-out;

linear:匀速变化;

ease-in:由慢到快;

ease-out:由快到慢;

ease和ease-in-out效果是一样的,都是由慢到快再到慢;

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template