У меня есть проект, в котором чистый ползунок css3 работает с 5 изображениями, а вычисления ключевых кадров такие же, как в скрипте css ниже. Я хочу увеличить это до 10 изображений и попытался поиграть с ключевыми кадрами, но не смог заставить его работать. Любая помощь в этом отношении будет оценена.
HTML:
<div id="captioned-gallery">
<figure class="slider">
<figure> <img src="./files/auto1.jpg" alt=""> </figure>
<figure> <img src="./files/auto8.jpg" alt=""> </figure>
<figure> <img src="./files/auto3.jpg" alt=""> </figure>
<figure> <img src="./files/auto4.jpg" alt=""> </figure>
<figure> <img src="./files/auto5.jpg" alt=""> </figure>
<figure> <img src="./files/auto1.jpg" alt=""> </figure>
</figure>
</div>
CSS:
figure.slider {
position: relative;
width: 1000%;
font-size: 0;
animation: 30s slidy infinite;
}
figure.slider figure {
width: 10%;
height: auto;
display: inline-block;
position: inherit;
}
figure.slider img {
width: 80%;
height: auto;
}
figure.slider figure figcaption {
position: absolute;
bottom: 0;
background: rgba(0,0,0,0.4);
color: #fff;
width: 100%;
font-size: 2rem;
padding: .6rem;
}
CSS3 ключевые кадры:
@keyframes slidy {
0% { left: 0%; }
10% { left: 0%; }
25% { left: -100%; }
45% { left: -100%; }
50% { left: -200%; }
70% { left: -200%; }
75% { left: -300%; }
95% { left: -300%; }
100% { left: -400%; }
}