From 842a28f2fb2fd7528570c5d7f7eec95c7866e1d1 Mon Sep 17 00:00:00 2001 From: subsub Date: Wed, 24 Jan 2024 10:37:25 +0900 Subject: [PATCH] =?UTF-8?q?2024/01/24=20fullmenu=20=EC=9B=B9=EC=A0=91?= =?UTF-8?q?=EA=B7=BC=EC=84=B1=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../visitEdu/usr/publish/script/common.js | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/main/webapp/visitEdu/usr/publish/script/common.js b/src/main/webapp/visitEdu/usr/publish/script/common.js index 927961de..b953ff00 100644 --- a/src/main/webapp/visitEdu/usr/publish/script/common.js +++ b/src/main/webapp/visitEdu/usr/publish/script/common.js @@ -10,6 +10,7 @@ $(document).ready(function () { var dep01_Text = $("#p_menu_nm_navi").text(); var dep02_Text = $("#menu_nm_navi").text(); + if($("#menu_nm_navi").length == 0){ dep02_Text = $("#sub").children(".cont_tit").find("h2").text(); }else{ @@ -63,6 +64,13 @@ $(document).ready(function () { var bdWid = $("body").width(); if (bdWid > 1024) { $(".full_menu").addClass("on"); // 1024 이상 시 전체 메뉴 열림 + + //웹접근성 포커싱 + $(".full_menu a").each(function(idx,itm){ + if(idx == 0){ + $(itm).focus(); + }else{} + }); } else { $("#m_menu").addClass("on"); // 1024 이하 시 모바일 메뉴 열림 } @@ -71,8 +79,37 @@ $(document).ready(function () { /* 전체메뉴 닫힘 */ $(".full_menu .btn_close").click(function () { $(".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 () {