News for hackers. Stuff that matters.
Re:MoveTo – A lightweight scroll animation JS library withou... by staktrace on Tuesday March 21, 2017 @08:16AM (#13921477)
Please note that as pointed out in the Microsoft article fron a few days ago, any JS-based scrolling is subject to main-thread jank. Instead, you should try to use the scroll-behavior CSS property [1] or scrollToOptions [2] in browsers where it is available, and only fall back to JS if it is not.

[1] https://developer.mozilla.org/en/docs/Web/CSS/scroll-behavio... [2] https://developer.mozilla.org/en-US/docs/Web/API/Element/scr...

Re:MoveTo – A lightweight scroll animation JS library withou... by imaginamundo on Tuesday March 21, 2017 @08:25AM (#13921523)
The library isn't about scroll hijack, is about "animate" anchor links. At least from what I get from the project. The scroll works as usual.
Re:MoveTo – A lightweight scroll animation JS library withou... by staktrace on Tuesday March 21, 2017 @08:40AM (#13921615)
Any scrolling on the main thread (i.e. driven by JS) is subject to jank, not just user-input scrolling. CSS-based smooth scrolling of anchor links can be offloaded to the compositor because the browser knows ahead of time what is going to happen, and in those cases the smooth scroll animation can run smoothly even if the main thread is bogged down.
Re:MoveTo – A lightweight scroll animation JS library withou... by kentt on Tuesday March 21, 2017 @08:44AM (#13921633)
It is a scroll hijacking library, it's just not as wretched as most. It's not animating the links but rather animating scrolling to the links by slowing the scrolling.
Re:MoveTo – A lightweight scroll animation JS library withou... by untog on Tuesday March 21, 2017 @08:35AM (#13921584)
To be clear: neither of those options is supposed by Chrome or Safari.

Sigh.