|
|
|
|
|
by madeofpalk
1790 days ago
|
|
This behaviour has nothing to do with scroll snapping. Scroll snapping is just "can i have a carousel without javascript", and is primarily a touch interaction. See this extremely brief demo https://codepen.io/tutsplus/pen/qpJYaK?editors=1100 I wouldn't call Square's site "scroll hijacking" - usually we use that to refer to when the actual native scroll behaviour/events are highjacked and prevented, and custom javascript scrolling happens. Instead on the Square site the DOM page is still scrolling natively, but an animation is progressed depending on the native page position. Maybe not ideal, but its much smoother and less jarring than actual scroll jacking. |
|
> For instance, it is easy for a user to land at an awkward scroll position which leaves an item partially on-screen when panning.
> To this end, this module introduces scroll snap positions which enforce the scroll positions that a scroll container’s scrollport may end at after a scrolling operation has completed.
Which is exactly what this page is doing.
> primarily a touch interaction
It's exclusively a scroll interaction, whether the pointer event is the result of mouse or touch input.
> the DOM page is still scrolling natively
I'm not sure what you're trying to say by "DOM page." JS is reacting to the scroll position of the viewport. The user experience is the same.