When creating HTML5 animations, is there a technique that can be used to "synchronize" the alternate text so that screen-readers reads the given element that appears the moment it appears (or triggered by an event / timeline-driven)?
Ideally, something that I could invoke with GSAP (using it as the animation library for my projects).
Or could such a thing just make the screen-reader speak and pause repeatedly too often, ending up sounding more frustrating than actually enhancing the experience of the user? Would I be better off just to paste essentially a "script" of all the animation that is going on, on one line in the alt="..."
attribute?
EDIT:
This question is mostly targetted for HTML5 ads - so I'm assuming there has to be a non-invasive way to screen-read the events happening in an animation without requiring the user to actually click the ad to gain focus (which would involuntarily open up the link the ad refers to). At the same time, wouldn't it be some sort of user violation to "force focus" on the ad's dynamic text if the user is in middle of reading an article / only interested to another area of the page? This raises so many other questions!
element.addEventListener('animationEnd',function...
see developer.mozilla.org/en-US/docs/Web/API/AnimationEvent/… to get you started – Oogonium<div>
. Don't know if you'll have to set thearia-live
attribute on the canvas itself or on an inner element though. – Meris$("#adDynamicText").focus()
to ensure the ad will actually get screen-read while it plays? – Breslauaria-hidden="true"
on the canvas element, add a visually hidden element that has the pertinent info from the ad, and associate them witharia-describedby
. – Daffodilaria-live
on it will just be annoying and without that if is dynamically updated, screen readers will not pick up the changes which is why I recommended putting the all the relevant content that will appear throughout the animation in the visually hidden element. – Daffodil