咔哒声和颌骨兼容性

问题描述 投票:0回答:1

在网页中,我试图在ng-click的帮助下打开一个叠加层,并且在java脚本的帮助下没有可用的href,正在调用相应的叠加层。当没有使用屏幕阅读器或正在使用NVDA屏幕阅读器时,此功能在键盘上正常工作。但是,当我使用Jaws屏幕阅读器时,功能根本不起作用。任何人都可以建议如何在不使用href的情况下解决此问题?这是我使用HTML的代码

    <a href="javascript:void(0)" ng-click="openModal()">
<h2 class="mu-item__title" ng-if="!hideInfo" data-share-title>{{videoData.title}} <span class="screenreader">{{item.contenttype_t}}</span></h2>

JavaScript代码

    $scope.openModal = function() {
if ($attrs.modalvideo) {                  
    $scope.openInModal = true;
    $scope.fromChild = false;
    $scope.genericData.showModal = true;
    $scope.genericData.isVideo = true;
    $scope.modalData = $scope.videoData;
}

};

任何人都可以建议在当前代码中需要更改什么?谢谢Anubhav Mitra

accessibility angularjs-ng-click jaws-screen-reader
1个回答
0
投票

尝试使用按钮而不是锚标记

    <button aria-label="{{item.contenttype_t}}" ng-click="openModal()" ng-if="!hideInfo">
      <h2 class="mu-item__title" data-share-title>{{videoData.title}}</h2>
    </button>
© www.soinside.com 2019 - 2024. All rights reserved.