I have a page in js . I wish that whenever I scroll I define how much of the page is scrolled . I don't want that I handle the scroll event , keep a state of old location , detect direction and then move to the required position .
Is there a way to define a fixed scroll height when scroll via mouse or press up/down arrow key or press up/down in scroll button
EDIT: FOUND https://codepen.io/andyadams/pen/omLOqZ
.y-mandatory {
scroll-snap-type: y mandatory;
}
however y snap does'nt work . X axis works but not y