I am working on a project that need to scroll using button and not using touch scrolling.
For this purpose, I have used a pure JavaScript code that I am sharing below, but this is stopping all the scrolling even Up / Down too. I just want to stop Horizontal scrolling in touch screen.
I think that it will be done by offsetX
or pageX
, but I am not able to mix this with below code. Hoping that you can make this...
<script type='text/javascript'>
// Stop Left/Right/Up/Down Scrolling In TouchScreen
window.addEventListener("touchmove", function(event) {
event.preventDefault();
}, false);
</script>