.widget .post-body ul {padding: 0;}
input[name="tab"] {display: none;}
.slider {
position: relative;
margin: 0 auto; max-width: 70%;
overflow: hidden; white-space: nowrap; word-wrap: normal;}
.slider li:nth-child(1) {
position: absolute; right: 0; bottom: 0; z-index: 2;
list-style: none; padding: 0 1em; background: rgba(255, 255, 255, .9);}
.slider li:nth-child(1) label {
animation-name: play0;
animation-duration: 40s;
animation-timing-function: linearsteps(5);
animation-iteration-count: infinite;}
label[for="tab2"] {animation-delay: 8s;}
label[for="tab3"] {animation-delay: 16s;}
label[for="tab4"] {animation-delay: 24s;}
label[for="tab5"] {animation-delay: 32s;}
.slider li:nth-child(n+2) {
position: relative; display: inline-block;
width: 100%; max-height: 0;
text-align: center; vertical-align: top; background: #fff;
animation-name: play, play1;
animation-duration: 40s;
animation-timing-function: linearsteps(5);
animation-iteration-count: infinite;}
.slider li:nth-child(2) {max-height: 500em;}
.slider li:nth-child(3) {animation-delay: 0s, 8s;}
.slider li:nth-child(4) {animation-delay: 0s, 16s;}
.slider li:nth-child(5) {animation-delay: 0s, 24s;}
.slider li:nth-child(6) {animation-delay: 0s, 32s;}
input[name="tab"]:checked ~ .slider li:nth-child(2) {max-height: 0;}
#tab1:checked ~ .slider li:nth-child(2) {max-height: 500em;}
#tab2:checked ~ .slider li:nth-child(3) {left: -100%; max-height: 500em;}
#tab3:checked ~ .slider li:nth-child(4) {left: -200%; max-height: 500em;}
#tab4:checked ~ .slider li:nth-child(5) {left: -300%; max-height: 500em;}
#tab5:checked ~ .slider li:nth-child(6) {left: -400%; max-height: 500em;}
.slider label[for="tab1"],
#tab1:checked ~ .slider label[for="tab1"],
#tab2:checked ~ .slider label[for="tab2"],
#tab3:checked ~ .slider label[for="tab3"],
#tab4:checked ~ .slider label[for="tab4"],
#tab5:checked ~ .slider label[for="tab5"] {color: red;}
.slider label, input[name="tab"]:checked ~ .slider label[for="tab1"] {color: #000;}
.slider img {
max-width: 100%;
padding: 0; margin: 0;
box-shadow: none; border: none;}
.slider:hover li, .slider:hover li label {animation-play-state:paused;}
input[name="tab"]:checked ~ .slider li label,
input[name="tab"]:checked ~ .slider li {animation: none;}
@keyframes play1 {
0%, 100% { max-height: 500em; }
22%, 99% { max-height: 0; }
}
@keyframes play {
0%, 20%, 100% { left: 0; }
21%, 40% { left: -100%; }
41%, 60% { left: -200%; }
61%, 80% { left: -300%; }
81%, 99% { left: -400%; }
}
@keyframes play0 {
21%, 100% { color: #000; }
0%, 20% { color: red; }
}@keyframes play1 {
0% { max-height: 500em; opacity: 0; }
1%, 19% { opacity: 1; }
20%, 100% { max-height: 0; opacity: 0; }
}
@keyframes play {
0% { left: 0; }
100% { left: -500%; }
}
@keyframes play0 {
0% { color: red; }
20%, 100% { color: #000; }
}
13 комментариев:
Итак смотрите как оно ДОЛЖНО работать
http://designmodo.com/image-slider-jquery-css3/
http://designmodo.com/responsive-slider/
И хотя идея похвальна, НО не надо городить , извиняюсь, бутор, если делаете, то делайте нормально и не забывайте ссылки ОТКРЫТЫЕ ставить на используемый материал.
Конечно, добавьте единый width и уберите max-height (см. пункт 9). Мне была интересна реализация именно "динамичной" высоты и адаптированной ширины. Отдельный пример с фиксированными значениями было делать откровенно лень. Проще из полученного результата убрать то, что не нужно.
В предпоследнем примере (по вашей ссылке) анимации не происходит. animation участвует лишь для того, чтобы в :target картинка плавно появлялась. Мне больше импонирует :checked или :focus с tabindex. Можно сделать намного проще. В ближайшее время покажу как я это вижу.
Или проще: взять из интернета скрипты, ориентированные на Blogger. Но их минус: индексироваться они не будут.
Спасибо за идею, я подумаю как-нибудь над реализацией, но попозже