Can you help me achieve a wave effect for elements appearing one by one using CSS animation (jQuery)? Currently, all the elements show up at once and I want to create a wave-like motion. Any assistance would be greatly appreciated.
$(window).scroll(function() {
$(".wave").each(function() {
var position = $(this).offset().top;
var winTop = $(window).scrollTop();
if (position < winTop + 650) {
$(this).addClass("slide-wave");
}
});
});
.wave {
visibility: hidden;
}
.slide-wave {
animation: slide-one .4s;
visibility: visible;
}
@keyframes slide-one {
0% {
opacity: 0;
transform: translateY(80%);
}
100% {
opacity: 1;
transform: translateY(0%);
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="wave"></div>
<div class="wave"></div>
<div class="wave"></div>
<div class="wave"></div>