How can I bind mouse wheel to the scroll-bar in a overflow-x scroll?

I have a div which contains 10 elements. I made the div a flex and overflow-x scroll. But when I hover over the div and use my mousewheel it does not scroll. So please help me how to use scroll it along the x to show the overflow content when I am over that div.
1 Reply
vattevaii
vattevaii9mo ago
Listen to scroll event on the div.. prevent it from bubbling to outer el.. then use delta from event to change the offset value of the div.. I don't have my code on me rn .. check to see if it's valid
Want results from more Discord servers?
Add your server