1
blz?
I have a "" with Parallax (parallaxie. js) and background image animation with CSS (Keyframes).
Follow the link: https://codepen.Io/Aguinaldo-Aranda/Pen/zLJwrM
It turns out that the animation is not 100%, sometimes it seems a bit buggy, after a few moments, a minute (sometimes less), the time between the transition of one background image and another decreases, gets very fast... I researched a lot about this type of animation, I tested several examples, the code exemplified in Codepen represents the best result I have.
Anyone can help?
Thank you
jQuery(function ($) {
$(".parallax").parallaxie({
speed: 0.55,
offset:0,
});
});
html{
overflow: visible;
}
body{
color: #fff;
}
section{
width: 100%;
color: #fff;
padding: 140px 0;
}
.parallax {position: relative; background-size: cover; overflow: hidden; background-attachment: fixed;background-repeat: no-repeat; }
.no-transition *, .swiper-container *, .mfp-container *, .skillbar-bar-main *, .portfolio-grid *, .parallax, .header-searchbar *, .header-social-icon * { transition-timing-function:initial; -moz-transition-timing-function:initial; -webkit-transition-timing-function:initial; -o-transition-timing-function:initial; -ms-transition-timing-function:initial; transition-duration: 0s; -moz-transition-duration: 0s; -webkit-transition-duration: 0s; -o-transition-duration: 0s; -ms-transition-duration: 0s; }
.slidein {
height: 100% !important;
width: 100%;
background-size: cover;
background-repeat: no-repeat;
background-position: 50%;
z-index: 0;
/*animation-delay: 2s !important; */
/*background-image: url(../images/bg_simulador.jpg); */
-webkit-animation: slidein ease-in-out 5s both infinite;
-moz-animation: slidein ease-in-out 5s both infinite;
animation: slidein ease-in-out 5s both infinite;
animation-direction: alternate;
}
@keyframes slidein {
0% {
background-image: url(http://www.kzulo.com.br/wp-content/uploads/2018/03/bg_ibi-1-1920x1070.jpg);
}
40% {
background-image: url(http://www.kzulo.com.br/wp-content/uploads/2018/03/bg_valclei-home-1920x1071.jpg);
}
80% {
background-image: url(http://www.kzulo.com.br/wp-content/uploads/2018/03/bg_tecfil_2-1920x1070.jpg);
}
100% {
background-image: url(http://www.kzulo.com.br/wp-content/uploads/2018/03/bg_ibi-1-1920x1070.jpg);
}
}
@-moz-keyframes slidein {
0% {
background-image: url(http://www.kzulo.com.br/wp-content/uploads/2018/03/bg_ibi-1-1920x1070.jpg);
}
40% {
background-image: url(http://www.kzulo.com.br/wp-content/uploads/2018/03/bg_valclei-home-1920x1071.jpg);
}
80% {
background-image: url(http://www.kzulo.com.br/wp-content/uploads/2018/03/bg_tecfil_2-1920x1070.jpg);
}
100% {
background-image: url(http://www.kzulo.com.br/wp-content/uploads/2018/03/bg_ibi-1-1920x1070.jpg);
}
}
@-webkit-keyframes slidein {
0% {
background-image: url(http://www.kzulo.com.br/wp-content/uploads/2018/03/bg_ibi-1-1920x1070.jpg);
}
40% {
background-image: url(http://www.kzulo.com.br/wp-content/uploads/2018/03/bg_valclei-home-1920x1071.jpg);
}
80% {
background-image: url(http://www.kzulo.com.br/wp-content/uploads/2018/03/bg_tecfil_2-1920x1070.jpg);
}
100% {
background-image: url(http://www.kzulo.com.br/wp-content/uploads/2018/03/bg_ibi-1-1920x1070.jpg);
}
}
<!DOCTYPE html>
<html>
<head>
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<script src="http://static.theultrasoft.com/parallaxie/parallaxie.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/>
<title></title>
</head>
<body>
<section id="simulador" class="parallax no-transition bg-img1 slidein conteudo_home">
<div class="container">
<div class="row">
<div class="col-md-8">
<h3 class="text-uppercase alt-font text-blue font-weight-600">
Lorem Ipsumw
</h3>
<p>Nulla sit amet congue turpis. Cras sagittis lacus sit amet nulla molestie, sit amet sollicitudin velit dictum. Aenean a urna nec mi imperdiet molestie. Cras placerat arcu non condimentum elementum. Maecenas maximus ultricies magna, sed hendrerit elit pulvinar non. Sed suscipit eros eu sollicitudin hendrerit. Donec porta porttitor ullamcorper. Vestibulum vulputate nibh vel libero faucibus ornare. Curabitur vehicula tincidunt quam, ac suscipit leo ullamcorper quis. Pellentesque pulvinar metus vel leo porttitor facilisis. Morbi scelerisque consectetur justo nec placerat. Aliquam lorem lacus, gravida non tristique nec, viverra sed massa. Integer luctus, dolor scelerisque mattis lacinia, erat diam interdum augue, a consectetur ipsum massa sed enim. Nullam fermentum hendrerit dui. Nulla et eros sed odio facilisis iaculis id ut eros.
Phasellus facilisis non purus vitae ultricies. Curabitur at felis sed risus facilisis porttitor. Aliquam vitae feugiat purus, non aliquam quam. Integer in tellus eget purus mollis efficitur id ut ipsum. Donec egestas in ex vel rhoncus. Fusce sit amet eros ex. Donec facilisis neque eget nisi tincidunt, eu pulvinar arcu vestibulum. Suspendisse sit amet urna egestas, lacinia ligula nec, ultrices metus. Fusce rutrum lorem massa. Praesent lacinia ipsum vitae erat lobortis aliquam. Donec tincidunt ante id sapien vehicula aliquet. Sed dolor metus, vulputate eu euismod et, commodo quis turpis. Nam non nunc ac ante gravida porttitor eget vel orci.</p>
<p>Nulla sit amet congue turpis. Cras sagittis lacus sit amet nulla molestie, sit amet sollicitudin velit dictum. Aenean a urna nec mi imperdiet molestie. Cras placerat arcu non condimentum elementum. Maecenas maximus ultricies magna, sed hendrerit elit pulvinar non. Sed suscipit eros eu sollicitudin hendrerit. Donec porta porttitor ullamcorper. Vestibulum vulputate nibh vel libero faucibus ornare. Curabitur vehicula tincidunt quam, ac suscipit leo ullamcorper quis. Pellentesque pulvinar metus vel leo porttitor facilisis. Morbi scelerisque consectetur justo nec placerat. Aliquam lorem lacus, gravida non tristique nec, viverra sed massa. Integer luctus, dolor scelerisque mattis lacinia, erat diam interdum augue, a consectetur ipsum massa sed enim. Nullam fermentum hendrerit dui. Nulla et eros sed odio facilisis iaculis id ut eros.
Phasellus facilisis non purus vitae ultricies. Curabitur at felis sed risus facilisis porttitor. Aliquam vitae feugiat purus, non aliquam quam. Integer in tellus eget purus mollis efficitur id ut ipsum. Donec egestas in ex vel rhoncus. Fusce sit amet eros ex. Donec facilisis neque eget nisi tincidunt, eu pulvinar arcu vestibulum. Suspendisse sit amet urna egestas, lacinia ligula nec, ultrices metus. Fusce rutrum lorem massa. Praesent lacinia ipsum vitae erat lobortis aliquam. Donec tincidunt ante id sapien vehicula aliquet. Sed dolor metus, vulputate eu euismod et, commodo quis turpis. Nam non nunc ac ante gravida porttitor eget vel orci.</p>
<p>Nulla sit amet congue turpis. Cras sagittis lacus sit amet nulla molestie, sit amet sollicitudin velit dictum. Aenean a urna nec mi imperdiet molestie. Cras placerat arcu non condimentum elementum. Maecenas maximus ultricies magna, sed hendrerit elit pulvinar non. Sed suscipit eros eu sollicitudin hendrerit. Donec porta porttitor ullamcorper. Vestibulum vulputate nibh vel libero faucibus ornare. Curabitur vehicula tincidunt quam, ac suscipit leo ullamcorper quis. Pellentesque pulvinar metus vel leo porttitor facilisis. Morbi scelerisque consectetur justo nec placerat. Aliquam lorem lacus, gravida non tristique nec, viverra sed massa. Integer luctus, dolor scelerisque mattis lacinia, erat diam interdum augue, a consectetur ipsum massa sed enim. Nullam fermentum hendrerit dui. Nulla et eros sed odio facilisis iaculis id ut eros.
Phasellus facilisis non purus vitae ultricies. Curabitur at felis sed risus facilisis porttitor. Aliquam vitae feugiat purus, non aliquam quam. Integer in tellus eget purus mollis efficitur id ut ipsum. Donec egestas in ex vel rhoncus. Fusce sit amet eros ex. Donec facilisis neque eget nisi tincidunt, eu pulvinar arcu vestibulum. Suspendisse sit amet urna egestas, lacinia ligula nec, ultrices metus. Fusce rutrum lorem massa. Praesent lacinia ipsum vitae erat lobortis aliquam. Donec tincidunt ante id sapien vehicula aliquet. Sed dolor metus, vulputate eu euismod et, commodo quis turpis. Nam non nunc ac ante gravida porttitor eget vel orci.</p>
</div>
</div>
</div>
</section>
</body>
</html>
hugocsl, thanks even for the help man. I changed by removing Fill-mode and Direction. I think it has improved a lot. Just do not understand the issue of the 5s, the image does not seem to figure 5 seconds, but I believe that this is due to the division of time in the keyframe, I used 0% and 100% the same image, switching to the other images in 40% and 80%. The size of the images are different only in this example that I built in the codepen, because I don’t have the online images that I will use, so I used any image and I didn’t notice the fact that they are not the same size. , sorry. Thanks for the Snippet id.
– Quati_Maldito
@Quati_blasted does not stay 5 second because you have 5s for the whole animation! If you want each image with 5s and vc has 3 images the animation should have 15s and not 5s... You also have to take into account that the time is the total time, including the transition of the fadein and fadeout of the image on the screen... Anything we are there. Good luck on the project
– hugocsl