Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That website confirms one of my greatest fears about this sort of thing (which I am otherwise moderately thrilled about): that scrolljacking is going to be widely employed. And scrolljacking is always bad, I have concluded. I have not encountered a single site that scrolljacks and does it right (whatever “right” means), though I have encountered two in the last decade that were quite close, but still definitely failed.

I’m using a Surface Book, which has a touchpad with precise two-finger scrolling. I use Firefox, and I tested it in Chrome and old Edge too just to be sure.

With JavaScript disabled, I can scroll horizontally and it works well. I like it.

With JavaScript enabled in Firefox and Chrome, scrolling either horizontally or vertically caused unreasonably fast horizontal scrolling. My guess is that it’s just scrolling the page a certain number of pixels horizontally per wheel event, and ignoring the delta which precise scroll devices provide. Even if it took the delta into account it’d still be wrong to scrolljack in this way because preventing the browser from doing the scrolling breaks inertial scrolling so that it cannot feel native. (This is a large part of why I say that scrolljacking is unconditionally bad: I believe that it’s genuinely impossible for web content to scrolljack and feel right, because the web platform doesn’t expose the necessary details.)

It behaves itself on old Edge, but has other layout bugs, which introduce a vertical scrollbar. I suspect that the scrolljacking script is detecting something (browser or vertical overflow) and disengaging, rather than that the scrolljacking is perfect on Edge.

I’d say that user agents should be responsible in cases like this for translating vertical scrolling into horizontal on such pages. Not user code. And definitely not if I scrolled horizontally myself and am using a device that reports deltas.



> That website confirms one of my greatest fears about this sort of thing (which I am otherwise moderately thrilled about): that scrolljacking is going to be widely employed.

The right fix is to ensure that the major browsers (and editors) handle this properly so that there is no urge to hijack scrolling. Mongolian is not the only vertical script.

> And scrolljacking is always bad, I have concluded. I have not encountered a single site that scrolljacks and does it right

Amen.


Horizontal scrolling seems to work just fine (macOS with Magic Mouse; same with trackpad). The fact that they included a workaround for those who don't have input devices with horizontal scrolling is a nice touch, yet it didn't interfere at all with my horizontal scrolling.

I'd say this is a decent tradeoff.


But that’s just the thing, and why scrolljacking is so bad—I’m on a platform with excellent horizontal scrolling facilities, and it’s ruining that. Based on my experience in this space, but not their code which I haven’t seen, I guess that this will affect at least all Windows users with precise touchpad scrolling. From my perspective, it’s a terrible trade-off. User agents need to handle this better, urgently.


Sounds like you should report the bug to Microsoft.


I’m saying that at a minimum I expect all Windows users to be affected by this.

It’s not a Microsoft problem at all: it’s that the web platform simply doesn’t support getting this type of scrolljacking right. It’s just not possible due to how scrolling is handled in the browser, how wheel events work, and the platform’s propensity to asynchrony (so that not only is it not supported, it can never be supported). The best you can achieve is to detect OS and browser and guess at how it’s going to behave, and emulate its functionality. And quite apart from how such things change over time, that’s not guaranteed to work at any particular time: such configuration is flexible per OS, and hardware (which you can’t detect reliably) can influences how it will do things as well. Inertia is a particularly good example of that: it varies in all of these ways, by hardware, by OS, by browser and by configuration in all three of these places. Now I don’t have macOS handy, so I can’t see how it handles the scrolling there. Perhaps that site’s developers (or some library they use) has done that emulation and tuned it for macOS, but not elsewhere.


I mean of TTB worked as well as LTR then scrolljacking should not be needed.


Did support improve recently? On Mojave with a MacBook trackpad, it's super janky.


I primarily interact with the web on desktop clients. This solution has been implemented perfectly for me. While I agree with your ideal, my guess is that it may take at least another decade for user agents to adopt a good solution for this, and until then, some scrolljacking will be necessary to improve my user experience.

Obviously it shouldn't interfere with touch scrolling, which is sometimes also done on laptop device screens (which typically conform to the desktop experience by default).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: