我尝试将键盘导航添加到Twitter引导手风琴以启用Web辅助功能,类似于http://hanshillen.github.io/jqtest/#goto_accordion。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Getting Started</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
</head>
<body>
<div class="row-fluid" id="main">
<div class="container">
<div class="row-fluid">
<div class="gutter10">
<div class="row-fluid">
<div class="span3" id="sidebar">
<div class="selections">
<h4 class="graydrkbg">Hello</h4>
</div>
</div>
<!--sidebar-->
<div class="span9" id="rightpanel">
<div class="gutter10">
<div class="accordion" id="accordion2">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
Collapsible Group Item #1
</a>
</div>
<div id="collapseOne" class="accordion-body collapse in">
<div class="accordion-inner">
<p>
<a href="http://en.wikipedia.org/wiki/Dogs" class="">More information about Dogs on Wikipedia</a>
</p>
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
Collapsible Group Item #2
</a>
</div>
<div id="collapseTwo" class="accordion-body collapse">
<div class="accordion-inner">
<p>Anim pariatur cliche...</p>
<p>
<a href="http://en.wikipedia.org/wiki/Dogs" class="">More information about Dogs on Wikipedia</a>
</p>
</div>
</div>
</div>
</div>
</div><!--gutter10-->
</div><!--rightpanel-->
</div><!--row-fluid-->
</div><!--gutter10-->
<!--container-->
</div><!--main-->
<!--footer-->
<script src="../js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="../js/bootstrap.js" type="text/javascript"></script>
</body>
</html>
答案 0 :(得分:0)
因此,由于缺乏更好的解决方案,我将采取以下措施:
要.collapse
我将添加display:none;
这会将其隐藏于有视力的用户和屏幕阅读器中。然后到.in
我将添加display:block;
,这将使它再次显示。因此,它会在关闭时跳过标签顺序中的内容,并在打开时将其添加回来。
这样:
.collapse {
display:none;
}
.in{
display:block;
}
我还没有在屏幕阅读器上进行测试,但我认为它应该适用于向下箭头回读文本。如果没有,我会更新。