Accessibility · Senior · Question 59 of 75
How do you respect reduced motion in JavaScript animations?
- 1Read
navigator.userAgentfor a motion setting - 2Check
matchMediaand listen for changes to it - 3Set
animation: noneon the<html>element
Show the answer
Correct answer: Check matchMedia and listen for changes to it
Explanation
CSS queries don't affect scripted animation, including smooth scrollTo and libraries, so you must check it yourself.