'js'
This commit is contained in:
parent
23a3757f9e
commit
ccfa6d9c97
|
|
@ -1215,6 +1215,13 @@ $(function() {
|
|||
// 1. 所有圖示先對螢幕閱讀器隱藏
|
||||
$icon.attr('aria-hidden', 'true');
|
||||
|
||||
// 特判:.close-screen-btn 內的圖示,移除無關的 sr-only 並設正確 aria-label
|
||||
if ($parent.hasClass('close-screen-btn')) {
|
||||
$parent.find('.sr-only').remove();
|
||||
$parent.attr('aria-label', '關閉公告視窗');
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. 已有 aria-label 或 sr-only 就不重複處理
|
||||
if ($icon.attr('aria-label') || $icon.next('.sr-only').length > 0 || $parent.find('.sr-only').length > 0) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue