我有一个由圆圈组成的时钟表盘,希望它们按顺序每秒钟出现一个,第一个从零开始变大到完整大小,然后再过1秒钟,第二个出现,以此类推。 (圆圈需要向中心扩展)
这是我的圆圈(总共会有12个):
<div id="research-area">
<a class="research-circle rs-<?php echo $counter; ?>" href="<?php echo the_permalink(); ?>" style="background-image:url(<?php echo the_field('icon'); ?>);"></a>
</div>
每个圆形类都有一个计数器,输出1、2、3等,最多到12。
如何使用CSS逐个展开每个圆?目前每个圆只是从左上角同时展开!
#research-area {
height: 883px;
width: 980px;
position: relative;
}
.research-circle {
height: 156px;
width: 174px;
display: block;
position: absolute;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
.research-circle:hover {
-webkit-transform: scale(1.1);
-moz-transform: scale(1.1);
-o-transform: scale(1.1);
-ms-transform: scale(1.1);
transform: scale(1.1);
}
.research-circle {
-webkit-animation: circle 1s;
-moz-animation: circle 1s;
-o-animation: circle 1s;
animation: circle 1s;
}
@keyframes circle {
0% {
height: 0px;
width: 0px;
}
100% {
height: 156px;
width: 174px;
}
}
@-webkit-keyframes circle {
0% {
height: 0px;
width: 0px;
}
100% {
height: 156px;
width: 174px;
}
}
@-moz-keyframes circle {
0% {
height: 0px;
width: 0px;
}
100% {
height: 156px;
width: 174px;
}
}
@-o-keyframes circle {
0% {
height: 0px;
width: 0px;
}
100% {
height: 156px;
width: 174px;
}
}
@keyframes circle {
0% {
height: 0px;
width: 0px;
}
100% {
height: 156px;
width: 174px;
}
}
.rs-1 {
left: 393px;
top: -2px;
}
.rs-2 {
left: 578px;
top: 47px;
}
.rs-3 {
left: 713px;
top: 183px;
}
.rs-4 {
left: 763px;
top: 367px;
}
.rs-5 {
left: 713px;
top: 551px;
}
.rs-6 {
left: 578px;
top: 687px;
}
.rs-7 {
left: 394px;
top: 736px;
}
.rs-8 {
top: 687px;
left: 209px;
}
.rs-9 {
left: 73px;
top: 551px;
}
.rs-10 {
left: 24px;
top: 367px;
}
.rs-11 {
left: 74px;
top: 182px;
}
.rs-12 {
left: 208px;
top: 47px;
}
a
标签会根据计数器而获得不同的类名 (1-12)? - Harry