The scroll-snap property in CSS gives you amazingly smooth and performant scroll snapping for both desktop and mobile browsers. Combine that with element.scrollIntoView() in JS and you have a complete and fully functional carousel that is wonderfully smooth and simple
- Learn more about scroll snap: [ Ссылка ]
- Browser support: [ Ссылка ]
- Try it out yourself: [ Ссылка ]
- Try a more complex example using JS to programmatically scroll [ Ссылка ]
![](https://s2.save4k.ru/pic/YBkvuXpc_wo/maxresdefault.jpg)