简体   繁体   中英

cross-fade gallery of images with 3 images left to it

I have a fiddle as shown below in which at the position 4 (picture 4, picture 5, picture 6) , I want cross-fade(fade-in/fade-out) gallery of images to happen. At present, it is showing only picture 6 at that position.

https://jsfiddle.net/k0vzthne/embedded/result

This is the CSS codes which I have used in the fiddle. At this moment, I don't see any cross-fade (fade-in/fade-out) gallery of images going on at position 4.

.featured-block a:nth-of-type(4), .featured-block a:nth-of-type(5), .featured-block a:nth-of-type(6) {
  position: absolute;
  right: 568px;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-duration: 12s;
  opacity: 1;
}

.featured-block a:nth-of-type(4) {
  animation-delay: 0s;
}

.featured-block a:nth-of-type(5) {
  animation-delay: 4s;
}


.featured-block a:nth-of-type(6) {
  animation-delay: 8s;
}

@keyframes cf4FadeInOut {
  0% {opacity: 0;}
    20% {opacity: 1;z-index: 999;}
    33% {opacity: 1;}
    53% {opacity: 0;z-index: 1;}
    100% {opacity: 0;}
}

Problem Statement:

I am wondering what changes I should make in the CSS codes above so that cross-fade gallery of images happen at position 4 (containing picture 4, picture 5 and picture 6) having 3 images left to it as present in the fiddle right now at position 1, position 2 and position 3 .

Maybe this is helping if i understand right:

 .item { background: red; display: inline-block; position: relative; width: 60px; height: 60px; } .item:nth-child(2n) { position: absolute; transition: opacity 400ms ease-in-out; opacity: 0; right: 0; } .item:hover + .item { background: green; z-index: 1; opacity: 1; } 
 <div class="list"> <div class="item">1 </div> <div class="item">2 </div> <div class="item">3 </div> <div class="item">4 </div> <div class="item">5 </div> <div class="item">6 </div> </div> 


The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM