1.0.0 • Published 2 years ago

@blackwall/scroll-converter v1.0.0

Weekly downloads
1
License
MIT
Repository
gitlab
Last release
2 years ago

@bchteam/scroll-converter

This script converts vertical scrolling to horizontal scrolling without any dependencies.

How it works

The methods from the package sets listener for mouse wheel scrolling the chosen element and updates the element's scrollLeft based on some calculations. Scrolling speed and step are not exactly the same as native scrolling's ones, but is good enough.

Usage

Install package

npm i -S @bchteam/scroll-converter

Import method

import scrollConverter from '@bchteam/scroll-converter'

Activate converting for element

const el = document.querySelector('.element-with-horizontal-scrolling')

scrollConverter.enable(el)

It can be deactivated also

scrollConverter.disable(el)
1.0.0

2 years ago