2024/01/24 fullmenu 웹접근성 수정

This commit is contained in:
subsub 2024-01-24 10:37:25 +09:00
parent 82ae7623c4
commit 842a28f2fb

View File

@ -10,6 +10,7 @@ $(document).ready(function () {
var dep01_Text = $("#p_menu_nm_navi").text(); var dep01_Text = $("#p_menu_nm_navi").text();
var dep02_Text = $("#menu_nm_navi").text(); var dep02_Text = $("#menu_nm_navi").text();
if($("#menu_nm_navi").length == 0){ if($("#menu_nm_navi").length == 0){
dep02_Text = $("#sub").children(".cont_tit").find("h2").text(); dep02_Text = $("#sub").children(".cont_tit").find("h2").text();
}else{ }else{
@ -63,6 +64,13 @@ $(document).ready(function () {
var bdWid = $("body").width(); var bdWid = $("body").width();
if (bdWid > 1024) { if (bdWid > 1024) {
$(".full_menu").addClass("on"); // 1024 이상 시 전체 메뉴 열림 $(".full_menu").addClass("on"); // 1024 이상 시 전체 메뉴 열림
//웹접근성 포커싱
$(".full_menu a").each(function(idx,itm){
if(idx == 0){
$(itm).focus();
}else{}
});
} else { } else {
$("#m_menu").addClass("on"); // 1024 이하 시 모바일 메뉴 열림 $("#m_menu").addClass("on"); // 1024 이하 시 모바일 메뉴 열림
} }
@ -71,8 +79,37 @@ $(document).ready(function () {
/* 전체메뉴 닫힘 */ /* 전체메뉴 닫힘 */
$(".full_menu .btn_close").click(function () { $(".full_menu .btn_close").click(function () {
$(".full_menu").removeClass("on"); $(".full_menu").removeClass("on");
$(".btn_menu").focus();
}); });
/* //전체메뉴 닫힘 */ /* //전체메뉴 닫힘 */
// 전체메뉴 포커스 아웃
$(".full_menu .btn_close").keydown(function (e) {
if (e.keyCode == "9") {
if (e.shiftKey) {
// shift+tab 했을 때
} else {
$(".full_menu").removeClass("on");
}
}
});
$(".full_menu a").each(function(idx,itm){
if(idx == 0){
$(itm).keydown(function (e) {
if (e.keyCode == "9") {
if (e.shiftKey) {
// shift+tab 했을 때
$(".full_menu").removeClass("on");
$(".depth01_li:first-child>a").focus();
} else {
}
}
});
}else{}
});
/* 모바일 메뉴 닫기 버튼 클릭 시 모바일 메뉴 닫힘 */ /* 모바일 메뉴 닫기 버튼 클릭 시 모바일 메뉴 닫힘 */
$("#m_menu .btn_close").click(function () { $("#m_menu .btn_close").click(function () {