Native horizontal scroll support
This commit is contained in:
parent
0f03be119b
commit
28addb3a38
@ -183,6 +183,11 @@ export default class Scrollable {
|
|||||||
if(!touchSupport) {
|
if(!touchSupport) {
|
||||||
const scrollHorizontally = (e: any) => {
|
const scrollHorizontally = (e: any) => {
|
||||||
e = window.event || e;
|
e = window.event || e;
|
||||||
|
if(e.which == 1) {
|
||||||
|
// maybe horizontal scroll is natively supports, works on macbook
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
|
const delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
|
||||||
this.container.scrollLeft -= (delta * 20);
|
this.container.scrollLeft -= (delta * 20);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user