mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 18:20:48 +01:00
refactor: update scroll script
This commit is contained in:
10
resources/js/horizontal-scroll.js
Normal file
10
resources/js/horizontal-scroll.js
Normal file
@@ -0,0 +1,10 @@
|
||||
let skinsElement = document.getElementById('skinsElement');
|
||||
|
||||
if (skinsElement) {
|
||||
skinsElement.addEventListener('wheel', (ev) => {
|
||||
if (skinsElement.scrollWidth > skinsElement.clientWidth) {
|
||||
ev.preventDefault();
|
||||
skinsElement.scrollLeft += (ev.deltaY + ev.deltaX);
|
||||
}
|
||||
}, { passive: false });
|
||||
}
|
||||
Reference in New Issue
Block a user