Hacker News new | ask | show | jobs
by bbx 4000 days ago
Surprised by the inclusion of "CSS Scroll Snap Points": https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap...

It basically allows to do scroll hijacking [1] without any JavaScript, just like this: http://blog.gospodarets.com/demos/scroll-snap-full-screen/

[1]: http://trentwalton.com/2013/10/23/scroll-hijacking/

6 comments

I'm torn.. I dislike scroll hijacking and in a sense don't want support for this practice, _but_ at the same time I assume this will never go away and then this seems less hacky and easier to make it work without ruining use on various input devices and settings.

For example, I tried the demo and saw how the pages jumped to the nearest page if I middle click and pulled down to go half way. Corner cases or anything more complicated than simple wheel flips often don't seem to work if you hack your own solution. Now the browser seems to have a much better idea of what's going on. So.. That's nice. We'll get hijacks but at least they seem to be much more robust? But at the same time I hope this won't make more designers hijack scrolling or go overboard with this. :\

People experimented with new ways of handling user input (as they have for decades), found that it was a good way to layout some pages, and then complained to browser vendors that doing it in JS sucks. CSS snap points is just a way to make the experience better for developers and users. That's exactly how the Web should work.

Personally I think CSS is "style hijacking" — the Web really is about the text, not the colors.

The Firefox/native version of the page works much better than the jQuery version. Both are a little bit janky with touchpad scrolling, but the native version allows you to scroll to the next page before waiting for the animation to finish. With a mousewheel, the native version is far better and acts as you expect; the jQuery version just feels like a terrible hack and doesn't let you scroll where you want, when you want.
Woah I did not expect it to work that well. I always hated scroll-hijacking webpages, because ~1% of them did it right.
As much as the effect can be irritating, Firefox lets you over-scroll before snapping which is a much better experience compared to that fallback jQuery plugin.