g4floyd / smooth-horizontal-scroll

Vanilla JS horizontal scroll functionality.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Smooth Horizontal Scroll

Vanilla JS smooth horizontal scroll functionality.

Create a parent container with id="scroll-container". Inside, place scrollable items with class="scroll-item".

See index.html for example of markup structure.

Initialize:

var horizontalScroll = smoothHorizontalScroll();
horizontalScroll.init();

Call every time you add a scroll item to scroll-container:

horizontalScroll.updateScrollItems();

About

Vanilla JS horizontal scroll functionality.


Languages

Language:JavaScript 66.3%Language:HTML 24.3%Language:CSS 9.4%