disable swipe/scroll up and down only over images on website

667 views Asked by At

I'm working on a website (first one, but have came a long ways) I have several site origin slider/carousels stacked on top of each other.

the website looks like netflix. The only issue I have is when scrolling up and down on mobile if you swipe on an image you can't scroll up or down unlike netflix. Does anyone know how to disable swipe up and down only on img tags?

1

There are 1 answers

0
Adam On

This is nothing to do with WordPress, I think this could be solved with jQuery.

I would assign a touch event to images you don't want to be able to scroll with and then lock the scrollbar.

$('img').bind('touchmove', function(e){e.preventDefault()})