繁体   English   中英

屏幕阅读器不自动读取 model window

[英]Screen reader not reading model window automatically

我正在尝试屏幕阅读器不会自动读取 JSP model window。 此模态 window 是第二个模态 window 第一个模态 window 是自动读取的。 但不是第二个 model window。

这是代码:

<div id=second-popup style="display:none" aria-live="polite" role="dialog"> 

<input type="hidden" id="none-label" value="nonetext"/>
<jsp:include page="somepagelinkhere.jsp" flush="true"/>
<html:hidden property="intialized"/>
<div class="div1">
<div class="div2">
<div class="div3">
<div class="div4">
<html:select styleId="" property="">
<html:options collection="" property="">
</html:select>
<html:select styleId="" property="">
<html:options collection="" property="">
</html:select>
</div>
<c:set var="var1"><bean:message  /></c:set>
<input type="hidden" value="" id="removelabel">


<div class="div5">
<form:label property="" >
<select name="country" id="countrylabel" class="country" >
<option value="">${countrieslist}</option>
<c:forEach var="" items="">
<option value=""> ${countrieslists}</option>
</forEach> 
</div>

<div id="city" class="citylist">
<form:label property="">
<select name="" id="" class="">
<option value=""></options>
</select>
</div>


</div>
</div>
</div>

,showhide: function(){ 
$("button").click(function(e){
e.preventDefault;
$("button").attr("aria-hidden","true");
$("second-popup").attr("style","display:block");
$("second-popup").attr("aria-hidden","false");
});
}


$(document).ready(function(){
$("first-popup").attr("tabindex",0);
$("first-popup").attr("tabindex",0);
$("Second-popup").focus();
});

在上面的代码中,第一个div包含第二个模态 window 内容代码蓝图。 我需要 NVDA 屏幕阅读器自动阅读此内容,我尝试将role="dialog" aria=labelledby="id" aria-describedby=""放在父div上,但屏幕阅读器仍然不会自动阅读。

我能够使屏幕阅读器自动读取模态覆盖的内容,并在我的覆盖部分结合以下内容:

aria-labelledby="title_id" aria-describedby="body_id" aria-live="assertive"

加上将焦点设置为覆盖内容中的自动对焦元素:

overlay.querySelector('*[autofocus]').focus();

它只能与所有这些东西一起工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM