【发布时间】:2015-01-11 23:28:33
【问题描述】:
我正在尝试将三个块一一上传,并且我想借助 CSS3 使动画控制变换。现在发生的事情是,它在谷歌浏览器中运行良好(正是我想要的方式),但在 Firefox 中运行不正常。在 Firefox 中,三个块首先可见,然后 css3 动画开始工作,这是我不想要的。我希望动画从一开始就出现在谷歌浏览器中。
body {
font-size: 14px;
line-height: 18px;
font-family: arial;
}
.wrapper {
width: 960px;
margin: 10px auto;
}
.one {
float: left;
width: 100px;
height: 100px;
margin: 20px 0;
border: 1px solid #afafaf;
background: #ddd;
animation: one 1s ease 1s;
-webkit-animation: one 1s ease 1s;
}
@keyframes one {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}
@-webkit-keyframes one {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}
.two {
float: left;
width: 100px;
height: 100px;
margin: 20px 0;
border: 1px solid #afafaf;
background: #ddd;
animation: two 2s ease 2s;
-webkit-animation: two 2s ease 2s;
}
@keyframes two {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}
@-webkit-keyframes two {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}
.three {
float: left;
width: 100px;
height: 100px;
margin: 20px 0;
border: 1px solid #afafaf;
background: #ddd;
animation: two 3s ease 3s;
-webkit-animation: two 3s ease 3s;
}
@keyframes three {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}
@-webkit-keyframes three {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}
<section class="wrapper">
<div class="one"></div>
<div class="two"></div>
<div class="three"></div>
</section>
【问题讨论】:
标签: css firefox animation transform