AI编程助手
AI免费问答

怎?停止css3属性animation,求助_html/css_WEB-ITnose

  2016-06-21 09:44   1719浏览 原创

CSS3 动画 HTML

nbsp;HTML>	<meta><title>Ball</title><style>		*{ margin: 0;padding: 0; }		.imgBox{			-webkit-transform: scale(3);			-webkit-animation-name : 'wobble';			-webkit-animation-duration : 1.5s;			-webkit-animation-timing-function : ease-in-out;			-webkit-animation-delay : 2s;			-webkit-animation-iteration-count : 1;			-webkit-animation-direction: normal;		}		@-webkit-keyframes 'wobble'{			from{				-webkit-transform: scale(3.0);			}			to{				-webkit-transform: scale(1);			}		}							.wrap{ width: 500px;height: 500px;overflow:hidden;margin: 0 auto; }	</style><div>	<div>		@@##@@	</div>
</div><script></script>

初始图片是放大3倍,然后通过-webkit-animation来还原图片的比例,动画执行完毕后,,怎么又回到3倍了.?
要怎么做啊?

回复讨论(解决方案)

nbsp;HTML>    <meta>    <title>Ball</title>    <style>        *{ margin: 0;padding: 0; }        .imgchange{width: 100px;height: 100px;}/*自己设置大小*/        .imgBox{            -webkit-transform: scale(3);            -webkit-animation-name : 'wobble';            -webkit-animation-duration : 1.5s;            -webkit-animation-timing-function : ease-in-out;            -webkit-animation-delay : 2s;            -webkit-animation-iteration-count : 1;            -webkit-animation-direction: normal;        }        @-webkit-keyframes 'wobble'{            from{                -webkit-transform: scale(3.0);            }            to{                -webkit-transform: scale(1);            }        }        .wrap{ width: 500px;height: 500px;overflow:hidden;margin: 0 auto; }    </style><div>    <div>        @@##@@    </div>
</div><script>    var tt = document.querySelector(".imgBox");    tt.addEventListener("webkitAnimationEnd", function(){ //动画停止时事务               this.className += 'imgchange';    }, false);</script>

.imgBox{
            -webkit-transform: scale(1);



默认情况下  动画样式处理完毕 则 普通样式发生作用

新的浏览器 css3 动画样式 可以增加一个关键字
定义动画后 用动画样式的最后样式渲染
忘记怎么拼了 你自己搜索下

新的浏览器 css3 动画样式 可以增加一个关键字
定义动画后 用动画样式的最后样式渲染
忘记怎么拼了 你自己搜索下
求具体写法啊,我也觉得应该有这么一个属性,要不然总用js也不是办法啊

前端入门到VUE实战笔记:立即学习
>在学习笔记中,你将探索 前端 的入门与实战技巧!

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。