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(); }