Slideshow Loop

I thought that would be easy to find a snippet for an auto slideshow with loop – no plugins or anything, just plain code. Turns out that most of the code out there moves to the first position when it reaches the end – and you can actually see moving to the beginning.

Personally, I was looking for a more smooth loop, to give the impression of an “infinite loop“. So I found that the secret is to use scrollLeft – can you believe it?! Here is the code I created for this type of carousel:

See the Pen Loop Slideshow by aflama (@aflama) on CodePen.light

Related posts: