是否可以检测iPhone上的网页中是否启用了VoiceOver? [英] Is it possible to detect if VoiceOver is on in a web page on iPhone?

查看:252
本文介绍了是否可以检测iPhone上的网页中是否启用了VoiceOver?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前正在使用touchmaplite JavaScript库测试在我们的移动网络应用上部署滑动地图(即,用手指在触摸屏设备上移动的地图)。此地图在我们的网页中嵌入为iframe。

We're currently testing deploying "slippy" maps (i.e., ones that move around with a finger on a touchscreen device) on our mobile web app, using the touchmaplite JavaScript library. This map is embedded as an iframe in our web page.

当我们在配备VoiceOver的iPhone上测试此设置时,我们发现VoiceOver在地图上卡住了,不会读过它(或者确实滚过它)。这对我们来说是一个很大的绊脚石,我们不希望在我们的网站上提供可访问性支持。

When we tested this setup on an iPhone with VoiceOver, we found VoiceOver gets "stuck" at the map, and won't read past it (or indeed scroll past it). This is a big stumbling block for us, we don't want to go backwards with accessibility support on our site.

是否可以将元素标记为忽略通过VoiceOver,或检测是否以任何其他方式启用VoiceOver(可能是JS),然后隐藏/删除iframe?

Is it possible to mark an element as to be "ignored" by VoiceOver, or to detect if VoiceOver is enabled in any other way (perhaps JS) and then hide/delete the iframe?

谢谢

推荐答案

我知道在Windows中,有一些关于如何检测是否正在使用屏幕阅读器的讨论。提到了一种可能(但不可靠)的方法,即在Flash中使用actionscript来查看是否正在使用WMicrosoft Active Accessibility层。 (http://www.paciellogroup.com/blog/?p=61)

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)

显然这没什么用,因为你是针对用户的语音,谁不会在他们的设备上有Flash支持,但我提到它只是为了让你知道其他平台做了什么 - 我对Apples并不太熟悉,所以不知道是否有类似于你可以使用的Flash。

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.

备选方案,只有一个隐藏的链接,配音用户可以跳过地图,可能会提醒他们VoiceOver被卡住的问题。

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'.

隐藏文本可以通过使用CSS来定位带有负边距的文本来实现,例如

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

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

以这种方式使用文字意味着有视力的用户无法看到它(除非他们禁用CSS),但仍然被屏幕阅读器读出。

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.

这篇关于是否可以检测iPhone上的网页中是否启用了VoiceOver?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆