首页 > 解决方案 > iPhone VoiceOver 不发音箭头的文本

问题描述

我有这个经过测试的页面http://fiddle.jshell.net/wt3dqm8b/1/show/light/(可以在这里编辑https://jsfiddle.net/wt3dqm8b/1/)。

Settings -> General -> Accessibility -> VoiceOver ON不幸的是,当您在打开 VoiceOver(">" 箭头。当您单击“>”箭头时,只有“链接”发音。尝试了很多方法,但没有一种方法能正常工作。

如何更改 html 代码,以便在单击“>”箭头时发出相同的文本“Link One link”?

这是上面页面中的代码:

HTML:

<ul  class="master secondary">
  <li  aria-expanded="false" class="main" tabindex="0" aria-label="Link One">
   <a  tabindex="-1" href="https://google.com">
   <span ><span > Link One </span></span>
   <i  class="fa fa-angle-right"></i>
   </a>
  </li>
  <li  aria-expanded="false" class="main" tabindex="0" aria-label="Link Two">
   <a  tabindex="-1" href="https://google.com">
   <span ><span > Link Two </span></span>
   <i  class="fa fa-angle-right"></i>
   </a>
  </li>
</ul>

CSS:

@import url('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css');
body {
  margin-top: 60px;
}


.master {
  margin: 0;
  padding: 0;
  list-style: none;
}

.master .main {
  border-bottom: 1px solid #ccc;
}

.master .main>a {
  position: relative;
  display: block;
  padding: 20px;
  color: green; 
  text-decoration: none;
  background-position: 15px;
}

.master .main > a .fa-angle-right {
  position: absolute;
  top: 50%;
  right: 30px;
  margin-top: -8px;
}

PS当然我不想显着改变html代码,所以:

更新: 即使在下面的代码中

<ul  class="master secondary">
  <li aria-expanded="false" class="main">
   <a  target="_self" href="https://google.com">
   <span ><span > Link One </span></span>
   <i class="fa fa-angle-right" title="Time to destination by car"><span class="sr-only">This text is not pronounced with VoiceOver - why?</span></i>
   </a>
  </li>
  <li aria-expanded="false" class="main">
   <a target="_self" href="https://google.com">
   <span ><span > Link Two </span></span>
   <span class="fa fa-angle-right" title="Time to destination by car"><span class="sr-only">This text is not pronounced with VoiceOver - why?</span></span>
   </a>
  </li>
</ul>

谢谢你。

标签: htmlfocusaccessibilityvoiceoverjaws-screen-reader

解决方案


我用你的 CSS 和Bootstrap 3 中的什么是 sr-only 中的“sr-only”类运行了你更新的代码?它与 VoiceOver 配合得很好。我在 iPhone 上运行 iOS 12.1.2。

导航到链接时,我听到“此文本不发音...”。

<a> 中包含的所有内容在 VoiceOver 中都被视为一个“制表位”,因此我无法专门滑动到“>”箭头。这就是我所期望的行为。如果“链接一”与“>”箭头具有相同的目标 ( ),则不应将“>”箭头作为单独的链接或制表位href


推荐阅读