【发布时间】:2014-09-15 17:27:58
【问题描述】:
现在谁能告诉我如何减慢幻灯片的显示时间?我希望所有幻灯片在页面加载时显示的持续时间与第一张幻灯片相同,但在第一张幻灯片之后,它们会很快开始循环。
.wavsplashslider {
position: relative;
top: 0;
left: 0;
width: 824px;
height:392px;
overflow:hidden;
}
.wavsplashslide {
width: 824px;
height:392px;
position: absolute;
top: 0;
left: 0;
-webkit-animation: slideshow 12s linear 0s infinite;
-moz-animation: slideshow 12s linear 0s infinite;
-ms-animation: slideshow 12s linear 0s infinite;
-o-animation: slideshow 12s linear 0s infinite;
animation: slideshow 12s linear 0s infinite;
}
.wavsplashslide:nth-child(2) {
-webkit-animation: slideshow 12s linear 4s infinite;
-moz-animation: slideshow 12s linear 4s infinite;
-ms-animation: slideshow 12s linear 4s infinite;
-o-animation: slideshow 12s linear 4s infinite;
animation: slideshow 12s linear 4s infinite;
}
.wavsplashslide:nth-child(3) {
-webkit-animation: slideshow 12s linear 8s infinite;
-moz-animation: slideshow 12s linear 8s infinite;
-ms-animation: slideshow 12s linear 8s infinite;
-o-animation: slideshow 12s linear 8s infinite;
animation: slideshow 12s linear 8s infinite;
}
@-webkit-keyframes slideshow {
25% {
opacity: 1;
left: 0;
}
33.33% {
opacity: 0;
left: -824px;
}
91.66% {
opacity: 0;
left: -824px;
}
100% {
opacity: 1;
left: 0
}
}
@-moz-keyframes slideshow {
25% {
opacity: 1;
left: 0;
}
33.33% {
opacity: 0;
left: -824px;
}
91.66% {
opacity: 0;
left: -824px;
}
100% {
opacity: 1;
left: 0
}
}
@-ms-keyframes slideshow {
25% {
opacity: 1;
left: 0;
}
33.33% {
opacity: 0;
left: -824px;
}
91.66% {
opacity: 0;
left: -824px;
}
100% {
opacity: 1;
left: 0
}
}
@-o-keyframes slideshow {
25% {
opacity: 1;
left: 0;
}
33.33% {
opacity: 0;
left: -824px;
}
91.66% {
opacity: 0;
left: -824px;
}
100% {
opacity: 1;
left: 0
}
}
@keyframes slideshow {
25% {
opacity: 1;
left: 0;
}
33.33% {
opacity: 0;
left: -824px;
}
91.66% {
opacity: 0;
left: -824px;
}
100% {
opacity: 1;
left: 0
}
}
<div class="wavsplashslider">
<div class="wavsplashslide">
<a href="http://stackoverflow.com">
<img src="http://lorempixel.com/824/392" />
</a>
</div>
<div class="wavsplashslide">
<a href="http://stackoverflow.com/questions">
<img src="http://lorempixel.com/824/392" />
</a>
</div>
<div class="wavsplashslide">
<a href="http://stackoverflow.com/tags">
<img src="http://lorempixel.com/824/392" />
</a>
</div>
</div>
【问题讨论】:
-
(O.T. 如果你已经在项目中使用了 jQuery...祝福 CSS3,jQ 中 5 行 110 行
:))
标签: html css animation slider slideshow