I am currently attempting to make my application be more user friendly to those with difficulty seeing. As one would expect, I am using JAWS to test my application. Most of the issues I have run in were relatively easy to fix, except I am stumped on one.
In my application, I have advertisements injected via an iframe and I want JAWS to ignore them, but I still want them to display (display:none is out of the question). Is there any way to have JAWS completely ignore an element and all of its children?
I saw a few posts leading towards speak:none, but that does not work. It does seems to ignore the parent div, but it will instead reads the content of the iframe child.
Any tips would be greatly appreciated.
Thank you.
Good for you for testing your web application for accessibility.
JAWS already has the feature built-in to ignore ads by temporarily or permanently ignoring inline iframes.
Testing that your site works nicely with that feature toggled should represent the typical experience for a JAWS user.
Banner Ads
If you want JAWS to temporarily ignore banner ads on a page, do the following:
- Press INSERT+V.
- Press I until you select "Inline Frames Show - On."
- Press the SPACEBAR to choose "Inline Frames Show - Off."
- Press ENTER.
To have JAWS permanently ignore all inline frames, including banner ads that you might encounter:
- In Internet Explorer, press INSERT+F2.
- Select Settings Center, and press ENTER.
- Focus is in the Search edit box. Type in "ignore inline" without the quotes.
- Press DOWN ARROW to move to Ignore Inline Frames in the filtered results of the tree view in Settings Center.
- Press SPACEBAR to check or uncheck the check box.
- Press TAB to move to the OK button and activate it with the SPACEBAR. The changes are made and saved. Settings Center closes.
The other points mentioned on the above link will give you a good idea of additional bad practices to avoid.
Give the ARIA attribute aria-hidden="true"
to the outer div of the iframe. This should ideally hide the the content from JAWS.
Give the aria attribute role="presentation" to any element you want ignored. Jaws will not read them.
来源:https://stackoverflow.com/questions/5107649/have-jaws-ignore-an-html-element