1
I’m trying to make an animation with automatic image exchange using the @keyframes
of css3
. I am copying and pasting the sample code, but without success. The transition between the images is taking place in a "crazy" way. See the snippet.
The animation I want to do is DEMO 3 - with MULTIPAS IMAGES: LINK - DEMO 3
#cf {
position:relative;
height:281px;
width:450px;
margin:0 auto;
}
#cf img {
position:absolute;
left:0;
-webkit-transition: opacity 2s ease-in-out;
-moz-transition: opacity 2s ease-in-out;
-o-transition: opacity 2s ease-in-out;
transition: opacity 2s ease-in-out;
}
#cf img.top {
animation-name: fadeInOut;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
animation-duration: 2s;
animation-direction: alternate;
}
#cf img.left {
animation-name: fadeInOut;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
animation-duration: 2s;
animation-direction: alternate;
}
@keyframes fadeInOut {
0% {opacity:1;}
17% {opacity:1;}
25% {opacity:0;}
92% {opacity:0;}
}
#cf img:nth-of-type(3) {
animation-delay: 2s;
}
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="estilo.css">
</head>
<body>
<div id="cf">
<img class="bottom" src="http://www.podagaita.com/img/fotos/imagem%20de%20aves%201.jpg" />
<img class="top" src="https://peregrinacultural.files.wordpress.com/2009/08/imagem-266.jpg" />
<img class="left" src="http://s3.amazonaws.savoir.com.br/cea.com.br/imagem/cadastrocqlv/imagem/cadastrocqlv-53440.jpg" />
</div>
</body>
</html>
The link you provided cannot be found. What about the problem is actually happening? What is not working?
– celsomtrindade
I fixed the @Celsomtrindade link I want to make an automatic transition between css3 images
– Zkk
How many images you are using to make this effect?
– celsomtrindade
I was wrong. It is the SECOND example of DEMO 3. MULTIPLE IMAGES!!! I want to make the transition with 3 images.
– Zkk
@Celsomtrindade I added a Snippet to the code. In it you can see how the image transition is with the "unregulated" time. This is the problem
– Zkk