This commit is contained in:
ken 2026-08-26 16:27:54 +08:00
parent aacb5df6f7
commit 52e948c7bd
1 changed files with 38 additions and 38 deletions

View File

@ -1515,48 +1515,48 @@ $(function() {
removeHiddenElementsInsideBrand();
}, 600);
//修正 Alt+M 定位點位置
$(function() {
var $accessKeyM = $('#accesskey_menu');
var $navbarHeader = $('.navbar-brand');
var $modulesMenu = $('.modules-menu');
// $(function() {
// var $accessKeyM = $('#accesskey_menu');
// var $navbarHeader = $('.navbar-brand');
// var $modulesMenu = $('.modules-menu');
function fixAccessKeyM() {
var windowWidth = $(window).width();
// function fixAccessKeyM() {
// var windowWidth = $(window).width();
if (windowWidth > 769) {
// 大螢幕:移到 .navbar-brand 前面
if ($navbarHeader.length > 0) {
$accessKeyM.insertBefore($navbarHeader);
$accessKeyM.css({
'display' : 'inline-block',
'position' : 'relative',
'float' : 'left',
});
}
} else {
// 小螢幕:移回 .modules-menu 第一個位置
if ($modulesMenu.length > 0) {
$accessKeyM.prependTo($modulesMenu);
$accessKeyM.css({
'display' : '',
'position' : '',
'float' : '',
'left' : '',
});
}
}
}
// if (windowWidth > 769) {
// // 大螢幕:移到 .navbar-brand 前面
// if ($navbarHeader.length > 0) {
// $accessKeyM.insertBefore($navbarHeader);
// $accessKeyM.css({
// 'display' : 'inline-block',
// 'position' : 'relative',
// 'float' : 'left',
// });
// }
// } else {
// // 小螢幕:移回 .modules-menu 第一個位置
// if ($modulesMenu.length > 0) {
// $accessKeyM.prependTo($modulesMenu);
// $accessKeyM.css({
// 'display' : '',
// 'position' : '',
// 'float' : '',
// 'left' : '',
// });
// }
// }
// }
// 初始執行
setTimeout(fixAccessKeyM, 500);
// // 初始執行
// setTimeout(fixAccessKeyM, 500);
// resize 監聽,加 debounce 避免頻繁觸發
var resizeTimer;
$(window).on('resize', function() {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(fixAccessKeyM, 150);
});
});
// // resize 監聽,加 debounce 避免頻繁觸發
// var resizeTimer;
// $(window).on('resize', function() {
// clearTimeout(resizeTimer);
// resizeTimer = setTimeout(fixAccessKeyM, 150);
// });
// });
//導覽選單子選單無障礙狀態修正 (支援多層級)
function fixNavMenuA11y() {