Mousecase is a JavaScript utility supporting touch-like horizontal scrolling with a mouse!
It is a no-nonsense, 0 dependency JavaScript plugin that solves 1 use case:
Scrolling a horizontal browser window plain with a mouse without using a scrollbar.
Synopsis
Being able to horizontally scroll is a default behavior on phones and with trackpads. With Mousecase, the archaic computer mouse pad can keep up! Yay. Users can click down on their computer mouse pad and drag scrollable horizontal browser window content without a scrollbar. This utility can help remove the need to implement a slider or carousel thingy. Therefore, it basically saves lives!
Setup
Install it!
yarn mousecase -D
Use it!
import mouseCase from 'mousecase'const mousecase = mouseCase('some-selector')mousecase.init()
That's it! Are you happier now that your customer can scroll horizontal web browser interfaces with a mouse pad just like they are on their phone? I hope so. If not, I'm not a shrink so I can't help you but I empathize—life's tough.
API
Listed below is the small API that Mousecase provides to use it.
MouseCase
MouseCase itself is a factory that takes in 2 arguments.
Arguments
target an string or node that is selected to use mousecase; is required