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:
parent
c679ab4882
commit
19fe5ad9f0
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user