I have a webpage where there is a slider like this https://tympanus.net/Tutorials/GooeyImageHoverEffects/. The problem is that vertial scroling is not working when I use the mouse wheel, only horizontal scroll is working when I use the mouse wheel. The webpage has a plugin named HorizontalScrollPlugin.js. Code of HorizontalScrollPlugin.js:
import Scrollbar from 'smooth-scrollbar'
export default class HorizontalScrollPlugin extends Scrollbar.ScrollbarPlugin {
transformDelta(delta, fromEvent) {
if (this.shouldInvertDelta(fromEvent)) {
return {
x: delta.y,
y: delta.y,
}
}
return delta
}
shouldInvertDelta(fromEvent) {
return this.options.events.some((rule) => fromEvent.type.match(rule))
}
}
HorizontalScrollPlugin.pluginName = 'horizontalScroll'
HorizontalScrollPlugin.defaultOptions = { events: [] }
I don't know what to change in this code to allow vertiall scrolling by using the mouse wheel. I tried this x: delta.x but it's not working. The rest of the code is here in github https://github.com/Aqro/gooey-hover-codrops. Can anyone help?