update
This commit is contained in:
parent
067ffdda4b
commit
2f63038c9f
|
|
@ -346,103 +346,80 @@ $(document).ready(function() {
|
|||
}
|
||||
},
|
||||
|
||||
ClickMenuHandler: function() {
|
||||
// 處理主選單切換(漢堡 icon)
|
||||
$(document).on('click', '.navbar-toggle', function (e) {
|
||||
e.preventDefault();
|
||||
ClickMenuHandler: function() {
|
||||
// 處理主選單切換(漢堡 icon)
|
||||
$(document).on('click', '.navbar-toggle', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
// 確保 .navbar-toggle 放到 .modules-menu 後面
|
||||
$('.mobile-menu').each(function () {
|
||||
var $menu = $(this);
|
||||
if ($menu.find('.modules-menu').length && !$menu.find('.modules-menu + .navbar-toggle').length) {
|
||||
$menu.find('.modules-menu').after($menu.find('.navbar-toggle'));
|
||||
}
|
||||
});
|
||||
|
||||
$('.mobile-menu').toggleClass('active');
|
||||
$('body').toggleClass('noscroll');
|
||||
|
||||
// ★ 修正:依據 active 狀態決定 collapsed 的加/移除
|
||||
if ($('.mobile-menu').hasClass('active')) {
|
||||
$('.mobile-menu .navbar-toggle').removeClass('collapsed'); // 打開 → 叉叉
|
||||
} else {
|
||||
$('.mobile-menu .navbar-toggle').addClass('collapsed'); // 關閉 → 三條橫線
|
||||
}
|
||||
|
||||
// 關閉所有下拉選單
|
||||
$('.mobile-menu1 > ul, .mobile-menu2 > ul').slideUp(500);
|
||||
$('.mobile-menu1 > .menu-drop, .mobile-menu2 > .menu-drop').removeClass('opened');
|
||||
|
||||
// 無障礙:聚焦第一個互動元素
|
||||
if ($('.mobile-menu').hasClass('active')) {
|
||||
setTimeout(function () {
|
||||
$('.modules-menu').find('input, button, select, textarea, a').first().focus();
|
||||
}, 100);
|
||||
// 確保 .navbar-toggle 放到 .modules-menu 後面
|
||||
$('.mobile-menu').each(function () {
|
||||
var $menu = $(this);
|
||||
if ($menu.find('.modules-menu').length && !$menu.find('.modules-menu + .navbar-toggle').length) {
|
||||
$menu.find('.modules-menu').after($menu.find('.navbar-toggle'));
|
||||
}
|
||||
});
|
||||
|
||||
// ✅ Tab 鍵跳過 .mobile-menu 時,觸發收合邏輯
|
||||
$(document).on('focusout', '.mobile-menu', function(e) {
|
||||
$('.mobile-menu').toggleClass('active');
|
||||
$('body').toggleClass('noscroll');
|
||||
$('.mobile-menu .navbar-toggle').removeClass('collapsed');
|
||||
|
||||
// 關閉所有下拉選單
|
||||
$('.mobile-menu1 > ul, .mobile-menu2 > ul').slideUp(500);
|
||||
$('.mobile-menu1 > .menu-drop, .mobile-menu2 > .menu-drop').removeClass('opened');
|
||||
|
||||
// 無障礙:聚焦第一個互動元素
|
||||
if ($('.mobile-menu').hasClass('active')) {
|
||||
setTimeout(function () {
|
||||
$('.modules-menu').find('input, button, select, textarea, a').first().focus();
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
// ✅ Tab 鍵跳過 .navbar-toggle 時,觸發與點擊相同的收合邏輯
|
||||
$(document).on('focusout', '.mobile-menu', function(e) {
|
||||
setTimeout(function() {
|
||||
var $newFocus = $(document.activeElement);
|
||||
|
||||
// 焦點在 body 時代表滑鼠正在點擊中,不處理
|
||||
if ($newFocus.is('body')) return;
|
||||
|
||||
if ($('.mobile-menu').hasClass('active') && $newFocus.closest('.mobile-menu').length === 0) {
|
||||
|
||||
var $btn = $('.navbar-toggle').first();
|
||||
|
||||
if ($btn.attr('data-bs-toggle')) {
|
||||
var target = $btn.attr('data-bs-target');
|
||||
var bsCollapse = window.bootstrap && bootstrap.Collapse.getInstance($(target)[0]);
|
||||
if (bsCollapse) bsCollapse.hide();
|
||||
$('.mobile-menu').removeClass('active');
|
||||
$('body').removeClass('noscroll');
|
||||
$('.mobile-menu .navbar-toggle').addClass('collapsed');
|
||||
$('.mobile-menu1 > ul, .mobile-menu2 > ul').slideUp(500);
|
||||
$('.mobile-menu1 > .menu-drop, .mobile-menu2 > .menu-drop').removeClass('opened');
|
||||
} else {
|
||||
$btn.trigger('click');
|
||||
var $newFocus = $(document.activeElement);
|
||||
// 焦點已離開 .mobile-menu 且選單是展開狀態
|
||||
if ($('.mobile-menu').hasClass('active') && $newFocus.closest('.mobile-menu').length === 0) {
|
||||
// ✅ 直接 trigger click,與按下 .navbar-toggle 執行完全相同的動作
|
||||
$('.navbar-toggle').first().trigger('click');
|
||||
}
|
||||
}
|
||||
}, 50);
|
||||
});
|
||||
});
|
||||
|
||||
$('.mobile-menu1 > .menu-drop').click(function(){
|
||||
var $that = $(this);
|
||||
var opencheck1 = $that.hasClass('opened');
|
||||
if ( opencheck1 == 0 ) {
|
||||
$('.mobile-menu1 > ul').not($that.siblings('ul')).slideUp(500);
|
||||
$('.mobile-menu1 > .menu-drop').not($that).removeClass('opened');
|
||||
$('.mobile-menu2 > ul').slideUp(500);
|
||||
$('.mobile-menu2 > .menu-drop').removeClass('opened');
|
||||
$that.siblings('ul').slideDown(500);
|
||||
$that.addClass('opened');
|
||||
$('.mobile-menu1 > .menu-drop').click(function(){
|
||||
var $that = $(this);
|
||||
var opencheck1 = $that.hasClass('opened');
|
||||
if ( opencheck1 == 0 ) {
|
||||
$('.mobile-menu1 > ul').not($that.siblings('ul')).slideUp(500);
|
||||
$('.mobile-menu1 > .menu-drop').not($that).removeClass('opened');
|
||||
$('.mobile-menu2 > ul').slideUp(500);
|
||||
$('.mobile-menu2 > .menu-drop').removeClass('opened');
|
||||
$that.siblings('ul').slideDown(500);
|
||||
$that.addClass('opened');
|
||||
|
||||
} else if (opencheck1 == 1) {
|
||||
$that.siblings('ul').slideUp(500);
|
||||
$('.mobile-menu2 > ul').slideUp(500);
|
||||
$('.mobile-menu2 > .menu-drop').removeClass('opened');
|
||||
$that.removeClass('opened');
|
||||
} else if (opencheck1 == 1) {
|
||||
$that.siblings('ul').slideUp(500);
|
||||
$('.mobile-menu2 > ul').slideUp(500);
|
||||
$('.mobile-menu2 > .menu-drop').removeClass('opened');
|
||||
$that.removeClass('opened');
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
$('.mobile-menu2 > .menu-drop').click(function(){
|
||||
var $that = $(this);
|
||||
var opencheck2 = $that.hasClass('opened');
|
||||
if ( opencheck2 == 0 ) {
|
||||
$('.mobile-menu2 > ul').not($that.siblings('ul')).slideUp(500);
|
||||
$('.mobile-menu2 > .menu-drop').not($that).removeClass('opened');
|
||||
$that.siblings('ul').slideDown(500);
|
||||
$that.addClass('opened');
|
||||
} else if (opencheck2 == 1) {
|
||||
$that.siblings('ul').slideUp(500);
|
||||
$that.removeClass('opened');
|
||||
}
|
||||
})
|
||||
}
|
||||
$('.mobile-menu2 > .menu-drop').click(function(){
|
||||
var $that = $(this);
|
||||
var opencheck2 = $that.hasClass('opened');
|
||||
if ( opencheck2 == 0 ) {
|
||||
$('.mobile-menu2 > ul').not($that.siblings('ul')).slideUp(500);
|
||||
$('.mobile-menu2 > .menu-drop').not($that).removeClass('opened');
|
||||
$that.siblings('ul').slideDown(500);
|
||||
$that.addClass('opened');
|
||||
} else if (opencheck2 == 1) {
|
||||
$that.siblings('ul').slideUp(500);
|
||||
$that.removeClass('opened');
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
// 把orbit物件加到window物件裡面並改名為ORBITFRONT來減少名稱衝突的機會
|
||||
|
|
@ -2248,6 +2225,14 @@ $(document).ready(function() {
|
|||
// if($('.show-announcement').hasClass('show-announcement')) {
|
||||
// $('.').css('', '');
|
||||
// }
|
||||
$(function() {
|
||||
var $headerNav = $('.header-nav');
|
||||
$headerNav.contents().each(function() {
|
||||
if (this.nodeType === 3 && this.nodeValue.trim() === '|') {
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#main-nav a[title="首頁"]').each(function(){
|
||||
$(this).html('<i class="fa-regular fa-house"></i>');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
@import "variables";
|
||||
|
||||
.fa-classic, .fa-regular, .fa-solid, .far, .fas ,.fa{
|
||||
font-family: var(--fa-style-family, "FontAwesome");
|
||||
font-family: "FontAwesome";
|
||||
}
|
||||
#orbit-bar .orbit-bar-inner > label:focus, #orbit-bar .orbit-bar-inner > label.focus{
|
||||
.orbit-bar-search-sign-language{
|
||||
|
|
|
|||
|
|
@ -2587,12 +2587,6 @@
|
|||
.i-annc__entry-title {
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
// clear: both;
|
||||
}
|
||||
|
||||
.i-annc__title {
|
||||
|
|
@ -2600,6 +2594,11 @@
|
|||
color: $theme-color-main;
|
||||
text-decoration: none;
|
||||
@extend .i-title;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
&:hover {
|
||||
color: $theme-color-second;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,9 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
<ul class="w-ba-banner__pager-2 banner-pager banner_caption_{{subpart-id}}"></ul>
|
||||
<div class="w-ad-banner__pager-2 w-ba-banner__caption banner-pager banner_caption_{{subpart-id}}" data-list="images" data-level="0">
|
||||
<li><button title="Slide {{slide_number}}" aria-label="Pager"><span style="display: none;">Slide {{slide_number}}</span></button></li>
|
||||
</div>
|
||||
<ul class="controlplay" role="radiogroup" aria-label="播放控制選項">
|
||||
<a role="radio" aria-checked="true" href="javascript:;" class="resume-slide active" title="繼續播放" aria-label="繼續播放" aria-live="assertive">
|
||||
<i aria-hidden="true"></i>
|
||||
|
|
|
|||
Loading…
Reference in New Issue