Is it possible to detect if VoiceOver is on in a web page on iPhone?

我的梦境 提交于 2019-12-03 14:32:33

I know with Windows, there has been some discussion on how to detect if a screenreader is being used. One possible (but unreliable) method was mentioned, that involved using actionscript within Flash to see if the WMicrosoft Active Accessibility layer was being used. (http://www.paciellogroup.com/blog/?p=61)

Obviously this is not much use as you are targetting voice over users, who will not have Flash support on their devices, but I mention it just so you're aware of what other platforms do - I'm not overly familiar with Apples, so don't know if there is anything similar to Flash you could use.

In your case, you could make use of hidden text, including a link, that would be picked up by screenreaders, but not sighted users, that would point to an alternate page for screenreader users; this alternate page could replicate your existing page, just without having the embedded map.

Alternative, have just a hidden link that voiceover\screenreader users can skip past the map with, perhaps alerting them to the issue with VoiceOver getting 'stuck'.

Hidden text can be achieved by using CSS to position text with a negative margin e.g.

.hiddenText {
position: absolute;
margin-left: -3000px;
}

Using text in this way means it is not visible to sighted users (unless they disable CSS), but is still read out by screenreaders.

Neither solution is what you're really looking for I'm afraid, but might give you some ideas.

aria-hidden is what you're looking for.

<div>some stuff</div>
<div aria-hidden="true">stuff you want to hide from the screen reader</div>
<div>more stuff</div>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!