@blackwall/scroll-converter

1.0.0 • Public • Published

@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)

Readme

Keywords

none

Package Sidebar

Install

npm i @blackwall/scroll-converter

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

189 kB

Total Files

6

Last publish

Collaborators

  • zakhse
  • diqost23