Fix accessibility.

This commit is contained in:
rulingcom 2023-07-08 16:56:26 +08:00
parent 20a520430e
commit 9978ce8c7e
1 changed files with 7 additions and 2 deletions

View File

@ -435,6 +435,11 @@
recalc_kenjohn_header(); recalc_kenjohn_header();
} }
}) })
$(document).on('click', '#accesskey_top', function(e){
open_kenjoh(true);
$(this).focus();
e.preventDefault();
})
var focusable_items = $('.mobile-menu').find('a, button'); var focusable_items = $('.mobile-menu').find('a, button');
var focusout_func1 = function(){ var focusout_func1 = function(){
if(window.is_press_tab){ if(window.is_press_tab){
@ -456,7 +461,7 @@
focusable_items.eq(0).off('focusout', focusout_func2); focusable_items.eq(0).off('focusout', focusout_func2);
} }
} }
$('#accesskey_menu').click(function(e){ $(document).on('click', '#accesskey_menu', function(e){
e.preventDefault(); e.preventDefault();
if(!$('body').hasClass('noscroll')){ if(!$('body').hasClass('noscroll')){
$('body').data('org-scrollY', window.temp_scrollY); $('body').data('org-scrollY', window.temp_scrollY);
@ -802,7 +807,7 @@ function transdate(){
if(_this.is('body')){ if(_this.is('body')){
return; return;
} }
if(_this.is('#gotocenter')){ if(_this.is('#gotocenter') || _this.is('#accesskey_top')){
open_kenjoh(true); open_kenjoh(true);
return; return;
} }