Completely disable ANY kind of vertical scroll in a DIV

220 views Asked by At

I need to disable ANY kind of vertical scrolling within an overflown DIV (I would still be able to scroll it horizontally).

overflow:hidden with CSS won't work since you can still scroll with the mouse wheel click / smartphone touch scroll. The only thing this does is hide the scroll bar, not disable it.

Is there any way to do this with Javascript or jQuery?

Thanks in advance.

1

There are 1 answers

0
TimPalmer On

Have you tried reducing the height of the div so there is no where to scroll.

You could put the screen height into a variable (or slightly less) and then make the div the same height therefore cutting off any content with the overflow hidden.