我的动画在Firefox和Chrome中很好,但不是IE10 / 11。我还尝试使用0%
和100%
代替from
和to
.object-left-side.move {
-webkit-animation: .75s ease 0s normal forwards 1 running move_left;
-moz-animation: .75s ease 0s normal forwards 1 running move_left;
-o-animation: .75s ease 0s normal forwards 1 running move_left;
-ms-animation: .75s ease 0s normal forwards 1 running move_left;
animation: .75s ease 0s normal forwards 1 running move_left;
}
@-webkit-keyframes move_left {
from { left: 50%;top:24%;}
to {left:5%;top:48%;}
}
@keyframes move_left {
from { left: 50%;top:24%;}
to {left:5%;top:48%;}
}
@-moz-keyframes move_left {
from { left: 50%;top:24%;}
to {left:5%;top:48%;}
}
@-ms-keyframes move_left {
from { left: 50%;top:24%;}
to {left:5%;top:48%;}
}
@-o-keyframes move_left {
from { left: 50%;top:24%;}
to {left:5%;top:48%;}
}
.object-left-side {
left: 50%;
position: absolute;
top: 24%;
z-index: 0;
}
答案 0 :(得分:0)
根据MSDN,
必须按以下顺序设置动画属性值:
动画名
动画持续时间
动画定时功能
动画延迟
动画迭代计数
动画方向
所以,换句话说,如果你写
animation: move_left .75s ease 0s 1 forwards;
它可以在IE11中使用。
.object-left-side.move {
-webkit-animation: .75s ease 0s normal forwards 1 running move_left;
-moz-animation: .75s ease 0s normal forwards 1 running move_left;
-o-animation: .75s ease 0s normal forwards 1 running move_left;
-ms-animation: .75s ease 0s normal forwards 1 running move_left;
animation: move_left .75s ease 0s 1 forwards;
}
@-webkit-keyframes move_left {
from {
left: 50%;
top: 24%;
}
to {
left: 5%;
top: 48%;
}
}
@keyframes move_left {
from {
left: 50%;
top: 24%;
}
to {
left: 5%;
top: 48%;
}
}
@-moz-keyframes move_left {
from {
left: 50%;
top: 24%;
}
to {
left: 5%;
top: 48%;
}
}
@-ms-keyframes move_left {
from {
left: 50%;
top: 24%;
}
to {
left: 5%;
top: 48%;
}
}
@-o-keyframes move_left {
from {
left: 50%;
top: 24%;
}
to {
left: 5%;
top: 48%;
}
}
.object-left-side {
left: 50%;
position: absolute;
top: 24%;
z-index: 0;
}
<div class="object-left-side move">Test</div>