Functioning smoothly on my personal computer but facing issues when accessed from a server. It seems to be starting out of sync for unknown reasons. Any help would be greatly appreciated. The code has only been vendor-prefixed for WebKit and has been tested in Chrome 26. Check out the demo here:
Here is the HTML:
<ul class="slides">
<li><img src="http://placehold.it/200x100" /><span class="caption">Image 1</span></li>
<li><img src="http://placehold.it/200x100" /><span class="caption">Image 2</span></li>
<li><img src="http://placehold.it/200x100" /><span class="caption">Image 3</span></li>
</ul>
The CSS used is as follows:
ul.slides{
position: relative;
background: #000;
height: 100px;
width: 200px;
padding: 0;
}
ul.slides li{
position: absolute;
left: 0px;
top: 0px;
right: 0px;
bottom: 0px;
height: inherit;
width: inherit;
padding: 0;
margin: 0;
-webkit-animation: slideshow 9s linear infinite;
}
ul.slides.clickpause:active li{
-webkit-animation-play-state:paused;
}
ul.slides li:nth-child(1){ -webkit-animation-delay: 0s; }
ul.slides li:nth-child(2){ -webkit-animation-delay: 3s; }
ul.slides li:nth-child(3){ -webkit-animation-delay: 6s; }
@-webkit-keyframes slideshow{
0%{
opacity: 0;
z-index: 2;
}
3%{
opacity: 1;
}
30%{
opacity: 1;
}
33%{
opacity: 0;
}
34%{
z-index: 1;
}
100%{
opacity: 0;
}
}
ul.slides li img{
position: absolute;
left: 0px;
top: 0px;
right: 0px;
bottom: 0px;
padding: 0;
margin: 0
}
ul.slides li span{
position: absolute;
left: 0px;
right: 0px;
bottom: 0px;
background: rgba(40, 40, 40, 0.8);
color: #FFF;
padding: 5px
}
Check out the demo here:
Please avoid solutions involving JavaScript. Thank you!