我的html文件中有三张图片,我想一次扩展一个。我已尝试在标识-moz-animation-delay: -2s;
和animation-delay:2s;
中放置这些延迟:#animation-container2
和#animation-container3
。所有图像仍然同时缩放。我做错了什么?
html
<div id="splashPage">
<ul>
<li> <img src="images/vintage.png" alt="Vintage" id="animation-container"> <li>
<li> <img src="images/computers.png" alt="Computer" id="animation-container2"> <li>
<li> <img src="images/online.png" alt="Online" id="animation-container3" > <li>
</ul>
<img src="images/enter.gif" alt="enter" id="enterClick">
</div>
CSS:
#animation-container {
animation: inout 2s;
animation-iteration-count: 1;
-webkit-animation: inout 3s; /* Safari & Chrome */
margin: auto;
}
@keyframes inout {
25% { transform: scale(2, 2); }
}
#animation-container2 {
-moz-animation-delay: 5s;
animation: inout 2s;
animation-iteration-count: 1;
-webkit-animation: inout 3s; /* Safari & Chrome */
margin: auto;
}
@keyframes inout {
25% { transform: scale(2, 2); }
}
#animation-container3 {
-moz-animation-delay: 10s;
animation: inout 2s;
animation-iteration-count: 1;
-webkit-animation: inout 3s; /* Safari & Chrome */
margin: auto;
}
@keyframes inout {
25% { transform: scale(2, 2); }
}
答案 0 :(得分:1)
以下是一些应该有效的新的更干净的CSS:
#animation-container {
animation: inout 2s 0s 1;
-webkit-animation: inout 2s 0s 1;
margin: auto;
}
#animation-container2 {
animation: inout 2s 5s 1;
-webkit-animation: inout 2s 5s 1;
margin: auto;
}
#animation-container3 {
animation: inout 2s 10s 1;
-webkit-animation: inout 2s 10s 1;
margin: auto;
}
@keyframes inout {
25% { transform: scale(2, 2); }
}
@-webkit-keyframes inout {
25% { -webkit-transform: scale(2, 2); }
}
请参阅fiddle。