我正在重新设计一个网站,不能使用Jquery来创建幻灯片。
我找到了幻灯片放映的CSS版本并将其修改为我喜欢的方式。
我现在只能在Internet Explorer中查看幻灯片放映,它在我测试的任何其他浏览器中都无法使用。我以为我使用了正确的前缀,但也许我并不理解这些。
我希望它可以在所有相关的现代浏览器中使用。
.css-slideshow{
position: relative;
max-width: 697px;
height: 288px;
margin-top:300px;
}
.css-slideshow figure{
margin: 0;
max-width: 697px;
height: 288px;
background: #000;
position: absolute;
}
.css-slideshow img{
box-shadow:;
}
.css-slideshow figcaption{
position: absolute;
top: 0;
color: #fff;
background: rgba(0,0,0, .3);
font-size: .8em;
padding: 8px 12px;
opacity: 0;
filter: alpha(opacity=0);
-webkit-transition: opacity .5s;
transition: opacity .5s;
}
.css-slideshow-attr{
max-width: 697px;
text-align: right;
font-size: .7em;
font-style: italic;
margin:0 auto;
}
.css-slideshow-attr a{
color: #666;
}
.css-slideshow figure{
opacity:0;
}
figure:nth-child(1) {
-webkit-animation: xfade 48s 42s infinite;
animation: xfade 48s 42s infinite;
}
figure:nth-child(2) {
-webkit-animation: xfade 48s 36s infinite;
animation: xfade 48s 36s infinite;
}
figure:nth-child(3) {
-webkit-animation: xfade 48s 30s infinite;
animation: xfade 48s 30s infinite;
}
figure:nth-child(4) {
-webkit-animation: xfade 48s 24s infinite;
animation: xfade 48s 24s infinite;
}
figure:nth-child(5) {
-webkit-animation: xfade 48s 18s infinite;
animation: xfade 48s 18s infinite;
}
figure:nth-child(6) {
-webkit-animation: xfade 48s 12s infinite;
animation: xfade 48s 12s infinite;
}
figure:nth-child(7) {
-webkit-animation: xfade 48s 6s infinite;
animation: xfade 48s 6s infinite;
}
figure:nth-child(8) {
-webkit-animation: xfade 48s 0s infinite;
animation: xfade 48s 0s infinite;
}
@keyframes xfade{
0%{
filter: alpha(opacity=100);
opacity: 1;
}
10.5% {
filter: alpha(opacity=100);
opacity: 1;
}
12.5%{
opacity: 0;
filter: alpha(opacity=0);
}
98% {
opacity: 0;
filter: alpha(opacity=0);
}
100% {
filter: alpha(opacity=100);
opacity: 1;
}
}
<div class="css-slideshow">
<figure>
<img src="http://www.offsetprinting.com/img/custom_images/review_slide/test_slide1.jpg" alt="class-header-css3" width="697" height="288" class="alignnone size-full wp-image-172" /><figcaption><strong>CSS3:</strong></figcaption>
</figure>
<figure>
<img src="http://www.offsetprinting.com/img/custom_images/review_slide/test_slide2.jpg" alt="class-header-semantics" width="697" height="288" class="alignnone size-full wp-image-179" /><figcaption><strong>Semantics:</strong></figcaption>
</figure>
<figure>
<img src="http://www.offsetprinting.com/img/custom_images/review_slide/test_slide3.jpg" alt="class-header-offline" width="697" height="288" class="alignnone size-large wp-image-178" /><figcaption><strong>Offline & Storage:</strong></figcaption>
</figure>
<figure>
<img src="http://www.offsetprinting.com/img/custom_images/review_slide/test_slide1.jpg" alt="class-header-device" width="697" height="288" class="alignnone size-full wp-image-177" /><figcaption><strong>Device Access:</strong></figcaption>
</figure>
<figure>
<img src="http://www.offsetprinting.com/img/custom_images/review_slide/test_slide2.jpg" alt="class-header-connectivity" width="697" height="288" class="alignnone size-large wp-image-176" /><figcaption><strong>Connectivity:</strong></figcaption>
</figure>
<figure>
<img src="http://www.offsetprinting.com/img/custom_images/review_slide/test_slide3.jpg" alt="class-header-multimedia" width="697" height="288" class="alignnone size-large wp-image-175" /><figcaption><strong>Multimedia:</strong></figcaption>
</figure>
<figure>
<img src="http://www.offsetprinting.com/img/custom_images/review_slide/test_slide1.jpg" alt="class-header-3d" width="697" height="288" class="alignnone size-large wp-image-174" /><figcaption><strong>3D, Graphics & Effects:</strong></figcaption>
</figure>
<figure>
<img src="http://www.offsetprinting.com/img/custom_images/review_slide/test_slide2.jpg" alt="class-header-performance" width="697" height="288" class="alignnone size-large wp-image-173" /><figcaption><strong>Performance & Integration:</strong></figcaption>
</figure>
</div>