Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 可访问性在Jaws中读取模式消息_Jquery_Modal Dialog_Accessibility - Fatal编程技术网

Jquery 可访问性在Jaws中读取模式消息

Jquery 可访问性在Jaws中读取模式消息,jquery,modal-dialog,accessibility,Jquery,Modal Dialog,Accessibility,大家好,我有一个使用jQueryUI的模式,尽管我正在努力使用JAWs使其可访问。代码包括在下面,我需要文本被读出时,模态启动点击调用页面。有什么我遗漏的吗?我添加了aria live=“assertive”,但似乎没有什么不同 #RequestMessage文本是使用ajax加载的。非常感谢您的任何建议 非常感谢, <div class="ui-dialog ui-widget ui-widget-content ui-corner-all " style="display: block

大家好,我有一个使用jQueryUI的模式,尽管我正在努力使用JAWs使其可访问。代码包括在下面,我需要文本被读出时,模态启动点击调用页面。有什么我遗漏的吗?我添加了aria live=“assertive”,但似乎没有什么不同

#RequestMessage文本是使用ajax加载的。非常感谢您的任何建议

非常感谢,

<div class="ui-dialog ui-widget ui-widget-content ui-corner-all " style="display: block; position: absolute; overflow: hidden; z-index: 1002; outline: 0px; height: auto; width: 633px; top: 466px; left: 355.5px;" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-VatInvoiceRequestModal"><div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" unselectable="on"><span class="ui-dialog-title" id="ui-dialog-title-VatInvoiceRequestModal" unselectable="on">&nbsp;</span><a href="#" class="ui-dialog-titlebar-close ui-corner-all" role="button" unselectable="on"><span class="ui-icon ui-icon-closethick" unselectable="on">close</span></a></div><div id="VatInvoiceRequestModal" aria-role="dialog" aria-describedby="RequestMessage" class="ui-dialog-content ui-widget-content" style="height: auto; min-height: 127px; width: auto;">

    <div class="modal-header">

        <a class="close-modal vat-modal" title="close" role="button" aria-label="close">
            <img src="close_button.png" width="17" height="17" alt="">
        </a>

    </div>

    <div class="modal-main" style="float: left;">

        <img style="margin-left: auto; margin-right: auto; display: none;" id="VatInvoiceRequestProgress" src="ajax-loader-white.gif" alt="">

        <p id="RequestMessage" style="tab-index: -1" aria-live="assertive">
            some text 
            <a href="#" target="_blank">hyperlink text</a>
        </p>

        <div style="display: none"></div>

        <div class="okay-button">

            <button type="button" class="test-modal" aria-label="Close">
               Close
            </button>

        </div>

        <br><br>

    </div>

</div></div>

接近


aria-live
仅在呈现页面时加载标记时有效,而在动态添加标记时无效(至少不使用Jaws和VoiceOver)。您可以遵循以下几种方法:

  • 添加javascript以在呈现时关注
    #RequestMessage
    。还向其添加一个标记
    tabindex=0
    ,以便对其进行聚焦

  • 将此标记添加到源的某个位置:

  • 然后,无论什么时候你想宣布什么,只要做$(“#shouter”).text(“喊这个”)

    我通常遵循第二种方法,即需要呈现来自多个源的多个通知。但是,如果您仅使用此模式作为警报,则第一种方法更为简洁

    <p aria-live="assertive" role="alert" id="shouter" style="position: absolute !important; right: -1000px !important;" tabindex="-1"></p>