I'm aiming to create an animated effect using jQuery that replicates the motion in this GIF. I experimented with CSS3 animation keyframes, but the result was not as clean and polished as I would like. If there is a simpler way to achieve this effect using CSS3, I'm open to suggestions.
Each CSS class that I want to apply includes a background color and background position.
<div class="displayer ico1"></div>
The sequence of CSS classes I intend to use are ico1 ico2 ico3 --- ico6
. Moreover, I aim to introduce a 3-second delay between each transition, ensuring that they cycle back to ico1 after reaching ico6.
Although aware of the .queue()
function, I struggle with implementing it effectively for this simulation.
Any assistance on this matter would be truly valued.
Thank you!
Edit----
I stumbled upon this jQuery plugin https://github.com/madbook/jquery.wait
It offers a tidy solution to execute this effect!
$('.displayer').addClass('ico1').wait(5000).removeClass('ico1').addClass('ico2').wait(5000).removeClass('ico2').addClass('ico3').wait(5000).removeClass('ico3').addClass('ico4').wait(5000).removeClass('ico4').addClass('ico5').wait(5000).removeClass('ico5').addClass('ico6').wait(5000).removeClass('ico6');
My only hurdle now is how to loop back to the beginning.
Any suggestions?