Search code examples
javascriptsliderfrontendslideautoplay

How can I create a slider with a smooth autoplay loop


I would like to create a slider like the one here" https://www.revolut.com/en-CZ , I'm working in Javascript

How can I make it so that the slider runs in a continuous loop, on autoplay, with a smooth transition?

Thanks


Solution

  • This can be done by the CSS property - "animation", with no need for Javascript added to that. Here is some JSfiddle example :

    https://jsfiddle.net/7p4j2a3u/1/
    code example

      animation: moveSlideshow 12s linear infinite;
    

    Heres also more detailed explenation about "animation" from Css Tricks

    https://css-tricks.com/almanac/properties/a/animation/