bilder-builder / _res /javascript.js
Sebastiankay's picture
Upload 5 files
3d31e14 verified
raw
history blame
953 Bytes
//component-15
const tabNav = document.querySelector("#component-153 > div.tab-nav.svelte-1uw5tnk")
//const tabNav = document.querySelector('.tab-nav');
tabNav.addEventListener("wheel", (event) => {
event.preventDefault()
const scrollLeft = tabNav.scrollLeft + event.deltaY
tabNav.scrollLeft = Math.max(0, Math.min(scrollLeft, tabNav.scrollWidth - tabNav.clientWidth))
})
tabNav.addEventListener("mouseover", () => {
tabNav.addEventListener("wheel", (event) => {
event.preventDefault()
const scrollLeft = tabNav.scrollLeft + event.deltaY
tabNav.scrollLeft = Math.max(0, Math.min(scrollLeft, tabNav.scrollWidth - tabNav.clientWidth))
})
})
tabNav.addEventListener("mouseout", () => {
tabNav.removeEventListener("wheel", (event) => {
event.preventDefault()
const scrollLeft = tabNav.scrollLeft + event.deltaY
tabNav.scrollLeft = Math.max(0, Math.min(scrollLeft, tabNav.scrollWidth - tabNav.clientWidth))
})
})