Skip to content
Snippets Groups Projects
Commit 9b2a34c5 authored by Olivia206's avatar Olivia206
Browse files

fixed horizontal scrolling

parent 46fda351
No related branches found
No related tags found
No related merge requests found
......@@ -98,13 +98,16 @@ class DraggableBlock {
handleScroll() {
this.content.addEventListener('wheel', (event) => {
const delta = event.deltaX;
if (delta !== 0) {
if (delta > 0) {
this.goTo(this.index+1);
} else {
this.goTo(this.index-1);
const deltaX = event.deltaX;
const deltaY = event.deltaY;
if (Math.abs(deltaX) > Math.abs(deltaY)) {
if (deltaX !== 0) {
if (deltaX > 0) {
this.goTo(this.index + 1);
} else {
this.goTo(this.index - 1);
}
}
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment