当前位置:   article > 正文

html循环效果关键帧动画,html – 关键帧动画 – 即时更改

html中让暂停的动画移动到不同的帧

您可以使用

steps作为计时功能暂停动画直到下一个关键帧

CSS:

-webkit-animation-timing-function: steps(1,end);

-moz-animation-timing-function: steps(1,end);

-ms-animation-timing-function: steps(1,end);

-o-animation-timing-function: steps(1,end);

animation-timing-function: steps(1,end);

示例代码:

@keyframes quick {

0% {

background-color:green;

}

50% {

-webkit-animation-timing-function: steps(1,end);

-moz-animation-timing-function: steps(1,end);

-ms-animation-timing-function: steps(1,end);

-o-animation-timing-function: steps(1,end);

animation-timing-function: steps(1,end);

background-color:blue;

}

100% {

background-color:red;

}

}

@-o-keyframes quick {

0% {

background-color:green;

}

50% {

-o-animation-timing-function: steps(1,end);

background-color:blue;

}

100% {

background-color:red;

}

}

@-moz-keyframes quick {

0% {

background-color:green;

}

50% {

-moz-animation-timing-function: steps(1,end);

background-color:blue;

}

100% {

background-color:red;

}

}

@-webkit-keyframes quick {

0% {

background-color:green;

}

50% {

-webkit-animation-timing-function: steps(1,end);

background-color:red;

}

100% {

background-color:blue;

}

}

body {

height:100%;

width:100%;

animation:quick 3s;

-moz-animation:quick 3s;

-webkit-animation:quick 3s;

-o-animation:quick 3s;

-webkit-animation-fill-mode: forwards;

-moz-animation-fill-mode: forwards;

-o-animation-fill-mode: forwards;

animation-fill-mode: forwards;

}

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/码创造者/article/detail/803844
推荐阅读
相关标签
  

闽ICP备14008679号