How to scroll down / up to scroll the page horizontally?
-
Hello, I need to make a horizontal scrolling site like https://in.game/ . I can track the up or down roll with this code:
var scrollTop = $(window).scrollTop(); $(window).scroll(function() { if($(window).scrollTop() > scrollTop){ console.log('down') scrollTop = $(window).scrollTop(); } else{ console.log('up') scrollTop = $(window).scrollTop(); } });
So here's how to make sure that when scrolling down, the page scrolls to the right. when scrolling up - to the left?JavaScript Anonymous, Aug 23, 2020 -
I think this will helpVivienne Stevens
1 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!