From ea4e198d2edd50ce06f3b0c36d706ed297b239fb Mon Sep 17 00:00:00 2001 From: rulingcom Date: Sat, 22 Jan 2022 10:47:06 +0000 Subject: [PATCH] fix error --- assets/javascripts/app.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js index ac567ce..2752921 100644 --- a/assets/javascripts/app.js +++ b/assets/javascripts/app.js @@ -718,12 +718,10 @@ function transdate(){ // 當文件物件模型(DOM)載入後,執行init函數 $(document).ready(function() { - $(document).on('keydown',function(event){ - var keyCode = event.which ? event.which : event.keyCode; - if($(document.activeElement==document.body) && keyCode==9){ - if (!$('header>.kenjohn').hasClass('navFixed')){ - $('header>.kenjohn').addClass('navRel'); - } + $(document).on('focus','*',function(){ + if ($('header>.kenjohn').attr('class') == "kenjohn"){ + $('header>.kenjohn').addClass('navRel'); + $('#gotocenter').focus(); } }); $('.group').each(function(){ @@ -897,7 +895,12 @@ function transdate(){ } }); - $('#main-nav>li').mouseover(function(){ + $('#main-nav>li').on('mouseover',function(){ + if (!calc_menu_flag){ + calc_menu_pos(); + } + }); + $('#main-nav>li>a').on('focus',function(){ if (!calc_menu_flag){ calc_menu_pos(); }