+ 4

How can I know in Java script the page scrollUp or down

Javascript

8th Dec 2020, 7:55 PM
Kirollos Samir
Kirollos Samir - avatar
7 odpowiedzi
+ 5
Take window.pageYOffset before scrolling happens and after scrolling happened Substract after from before .. if negative, the scroll direction is up, if positive it's down
8th Dec 2020, 8:48 PM
Ali Kh
Ali Kh - avatar
+ 4
You will use window.onscroll() event to detect scrolling and take to the scroll positions before and after
8th Dec 2020, 8:49 PM
Ali Kh
Ali Kh - avatar
+ 1
How can I know in Java script the page scrollUp or down
22nd Dec 2020, 7:19 AM
Юрій Гаврилик
Юрій Гаврилик - avatar