Accessible Images: Animation
- All images, including animated images, must have alternative text (see Images: Alternative Text).
- Any animation that starts automatically and moves for more than 5 seconds must provide a way to pause the movement.
An image that starts automatically and moves for more than 5 seconds must provide a way to pause the movement. This applies to element transitions, animated gifs, parallax scrolling, and code-based moving elements such as data visualizations and animated features.
Why? Automatic movement can trigger vertigo and seizures in users with some vestibular conditions, and it is distracting to users with some learning and cognitive disorders. However, sometimes no other method will achieve the desired effect, and animation is necessary. In these cases, ensure that your animations comply with WCAG 2.1 guidelines.
For animated gifs, do one of the following:
- Provide a play button: The Giffer script will provide a play button on animated gifs, allowing for greater user control over the interface (instructions for implementing the Giffer script).
- Provide a pause button: We currently know of no programmatic way to automatically play a video while providing a pause button. If anyone comes across one, please let us know.
- Play (loop) the animation for less than 5 secs: You will need to modify the number of times an animation loops. You can change the number of loops using an online tool like ezgif.com or desktop graphics software like Photoshop:
- Open the animated gif in Photoshop.
- Go to Window > Timeline (if the Timeline panel is not already open).
- At the bottom of the Timeline panel, you will see an option that says "Forever." Change that to "Once" (or choose "Other" and change it to "2," depending on the length of the animation).
- Go to File > Export > Export for Web and save it as a gif.
ASU Web Standards
In addition to WCAG 2.1, ASU has additional university standards for animation. Even if your site is not a college or unit site, we recommend you take a look at these standards as they are detailed and well-researched.
How to test
Manually inspect any pages with animated elements. If they automatically play, they must either (a) provide a pause button or (b) automatically stop after 5 seconds. The best user experience is to not automatically play animations, but to give the user a play button and, thus, as much control over the user interface as possible.
Relevant W3C WAI documents
- WCAG 2.1 Guideline 1.1.1 Non-text Content: All non-text content that is presented to the user has a text alternative that serves the equivalent purpose.
- How to Meet WCAG 2.1 Guideline 1.1.1
- WCAG 2.1 Guideline 2.2.2 Pause, Stop, Hide: For any moving, blinking or scrolling information that (1) starts automatically, (2) lasts more than five seconds, and (3) is presented in parallel with other content, there is a mechanism for the user to pause, stop, or hide it unless the movement, blinking, or scrolling is part of an activity where it is essential...
- How to Meet WCAG 2.1 Guideline 2.2.2