【发布时间】:2016-05-01 06:45:33
【问题描述】:
一旦我开始制作动画,在 Chrome 上我会得到涟漪效果。我的圆形变换放大了。在 Firefox 上,由于某种原因,完全相同的动画会被忽略。
$("#animate").click(function() {
$("#square").toggleClass("animate");
$("#fab").toggleClass("ripple");
});
@keyframes ripple {
from {
transform: scale(0)
}
to {
transform: scale(20)
}
}
#square {
position: relative;
width: 300px;
height: 300px;
overflow: hidden;
border: 1px solid red;
transition: background 0.1s linear 0.6s, transform 1s;
transform: rotate(0deg);
}
#fab {
position: absolute;
width: 56px;
height: 56px;
border-radius: 50%;
background: #4FB5AB;
top: 122px;
right: 0;
transform: scale(1);
transition: transform 1s;
}
.ripple {
animation: ripple 1s 0.5s;
transform: scale(20) !important;
/*Duration - delay */
transition: transform 0s 1s !important;
}
.animate {
transform: rotate(90deg) !important;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="square">
<div id="fab"></div>
</div>
<br />
<button id="animate">animate</button>
【问题讨论】:
-
我不确定是什么问题。你能详细说明一下吗?
-
@AMACB 你在 Firefox 和 Chrome 上都试过动画了吗?
-
哦,我没有看到动画按钮。嗯,这很奇怪。
-
@AMACB 你现在注意到问题了吗?
-
我认为你需要定义一个
@-moz-keyframe:stackoverflow.com/questions/21143893/…
标签: css firefox css-transitions css-animations