1
0
mirror of https://github.com/meineerde/holgerjust.de.git synced 2025-10-17 17:01:01 +00:00

Don't scroll down slowely if the user requested reduced motion

This commit is contained in:
Holger Just 2017-07-26 14:40:24 +02:00
parent c679ab4882
commit 19fe5ad9f0

View File

@ -29,6 +29,12 @@
// speed: time in pixels per second
// easing: easing equation to use
// Don't scroll slowly if the user requested reduced motion
if (matchMedia('(prefers-reduced-motion)').matches) {
window.scrollTo(0, scrollTargetY);
return;
}
var scrollY = window.scrollY,
scrollTargetY = scrollTargetY || 0,
speed = speed || 2000,