【发布时间】:2015-05-11 22:11:34
【问题描述】:
为了在 5 秒后隐藏一个元素,我使用了下面的代码。
但它在 Firefox 中不起作用。
.classname {
-webkit-animation: cssAnimation 0s ease-in 5s forwards;
-moz-animation: cssAnimation 0s ease-in 5s forwards;
-o-animation: cssAnimation 0s ease-in 5s forwards;
animation: cssAnimation 0s ease-in 5s forwards;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
@keyframes cssAnimation {
to {
width:0;
height:0;
overflow:hidden;
}
}
@-webkit-keyframes cssAnimation {
to {
width:0;
height:0;
visibility:hidden;
}
}
<div class="classname">This will hide</div>
【问题讨论】:
-
感谢您的代码在 chrome 中适用于我,您的问题的解决方案在 Firefox 中适用于我...非常感谢。
标签: css css-transitions css-animations