508 - Will screenreader read object that is hidden on page show

cmercado7165
cmercado7165 Community Member Posts: 3
As the title says,

 

I am working on a few dozen courses and I need to understand a key mechanic for 508 accessibility.

I know that initially hidden prevents an object from being read by a screenreader [so does empty alt tags].

 

But I have the following situation:

On Page Show -  Hide Text Box A - if Variable = 1

On Page Show - Hide Text Box B - if Variable = 0.

This is an abstraction of my actual problem but the point stands.   Neither object is initially hidden in the properties menu. Will a screenreader still read both text boxes no matter what?

What if it wasn't on page show, but tagged to an audio event?

 

Does a screenreader know everything it is going to read immediately when the page is loaded? or does it go object by object - and if the object is hidden or gone before it gets there, it skips it?

Thank you, I realize this is a very abstract question,

- Carlos

 

Comments

  • jasonadal
    jasonadal Community Member Posts: 441 ♪ Opening Act ♪
    Hi Carlos - I, too, have done quite a bit of work making sure my courses are compliant and compatible with screen readers, so I'll offer what I've learned in my testing and consulting.

    When you choose to hide a text block, it includes the attribute "visibility: hidden" and will not be read by a screen reader, even if "Initially Hidden" is not selected. Screen readers typically do not start reading until the page is fully rendered. I say typically because there may be a setting within the screen reader to start immediately rather than waiting for the page to finish loading.

    I've used a different solution for this scenario using Change Contents, assigning a class to the text block, and JavaScript to add an attribute to the text block. There is an attribute "aria-live" that can be used on elements to alert screen readers of changes on a site and can be "assertive" or "polite". I've attached a short sample with how I implement the solution.

    I'd recommend browsing the WebAim.org site that has a ton of information on 508/WCAG solutions. One specific page is on Invisible Content Just for Screen Reader Users that addresses this to some extent. You can also download NVDA, which is a free (donation appreciated) screen reader that is very similar to JAWS, to do some testing.