This commit is contained in:
ken 2026-08-28 13:54:59 +08:00
parent 48c3770079
commit 8577107615
1 changed files with 17 additions and 2 deletions

View File

@ -1755,17 +1755,32 @@ $(function() {
var key = getTabKey($currentTab);
var $visibleItems = getVisibleItems($scope, key);
// Shift+Tab若是第一個連結跳回對應頁籤
// 找出當前類別的 .w-annc__more
var $more = $scope.find('.w-annc__more-wrap a, .w-annc__more').filter(':visible').first();
// Shift+Tab若在第一個連結跳回對應頁籤
if (e.which === 9 && e.shiftKey) {
if ($currentLink.is($visibleItems.find('a').first())) {
e.preventDefault();
$currentTab.focus();
}
// Shift+Tab若在 .w-annc__more跳回最後一個公告連結
if ($more.length && $currentLink.is($more)) {
e.preventDefault();
$visibleItems.find('a').last().focus();
}
}
// Tab若是最後一個連結跳到下一個頁籤並切換
// Tab在最後一個連結,跳到 .w-annc__more
if (e.which === 9 && !e.shiftKey) {
if ($currentLink.is($visibleItems.find('a').last())) {
if ($more.length) {
e.preventDefault();
$more.focus();
}
}
// Tab若在 .w-annc__more才跳到下一個頁籤
if ($more.length && $currentLink.is($more)) {
var $nextTab = $currentTab.next('.filter_tab');
if ($nextTab.length > 0) {
e.preventDefault();