This commit is contained in:
ken 2026-08-28 14:02:37 +08:00
parent 9939c6feff
commit 5d014c999e
3 changed files with 98 additions and 58 deletions

View File

@ -1,66 +1,66 @@
;(function($, win, undefined) { ;(function($, win, undefined) {
// ECMAScript 5 嚴格模式 // ECMAScript 5 嚴格模式
'use strict'; 'use strict';
$(function() { // $(function() {
var $signLanguageBox = $('.orbit-bar-search-sign-language'); // var $signLanguageBox = $('.orbit-bar-search-sign-language');
var $headerNav = $('.header-nav'); // var $headerNav = $('.header-nav');
var $target = $('.header-nav [accesskey="U"], .header-nav [accesskey="W"]'); // var $target = $('.header-nav [accesskey="U"], .header-nav [accesskey="W"]');
// 移除 color: inherit !important // // 移除 color: inherit !important
$target.each(function() { // $target.each(function() {
$(this)[0].style.removeProperty('color'); // $(this)[0].style.removeProperty('color');
}); // });
function handleNavMove() { // function handleNavMove() {
var windowWidth = window.innerWidth; // var windowWidth = window.innerWidth;
if (windowWidth > 768) { // if (windowWidth > 768) {
if ($signLanguageBox.length && $signLanguageBox.find('[accesskey="U"], [accesskey="W"]').length === 0) { // if ($signLanguageBox.length && $signLanguageBox.find('[accesskey="U"], [accesskey="W"]').length === 0) {
$signLanguageBox.prepend($target); // $signLanguageBox.prepend($target);
} // }
} else { // } else {
if ($headerNav.length && $headerNav.find('[accesskey="U"], [accesskey="W"]').length === 0) { // if ($headerNav.length && $headerNav.find('[accesskey="U"], [accesskey="W"]').length === 0) {
$headerNav.append($target); // $headerNav.append($target);
} // }
} // }
} // }
handleNavMove(); // handleNavMove();
$(window).on('resize', function() { // $(window).on('resize', function() {
handleNavMove(); // handleNavMove();
}); // });
}); // });
//blockquote移動 // //blockquote移動
$(function() { // $(function() {
// 1. 定義變數,減少重複選取 DOM 的效能消耗 // // 1. 定義變數,減少重複選取 DOM 的效能消耗
var $signLanguageBox = $('.orbit-bar-search-sign-language'); // var $signLanguageBox = $('.orbit-bar-search-sign-language');
var $headerNav = $('.header-nav'); // var $headerNav = $('.header-nav');
var $target = $('.header-nav blockquote'); // var $target = $('.header-nav blockquote');
function handleNavMove() { // function handleNavMove() {
var windowWidth = window.innerWidth; // var windowWidth = window.innerWidth;
if (windowWidth > 768) { // if (windowWidth > 768) {
if ($signLanguageBox.length && $signLanguageBox.find('blockquote').length === 0) { // if ($signLanguageBox.length && $signLanguageBox.find('blockquote').length === 0) {
$signLanguageBox.prepend($target); // $signLanguageBox.prepend($target);
} // }
} else { // } else {
if ($headerNav.length && $headerNav.find('blockquote').length === 0) { // if ($headerNav.length && $headerNav.find('blockquote').length === 0) {
$headerNav.append($target); // 或者用 .prepend() 取決於你要放的位置 // $headerNav.append($target); // 或者用 .prepend() 取決於你要放的位置
} // }
} // }
} // }
// 初始執行一次 // // 初始執行一次
handleNavMove(); // handleNavMove();
// 監聽視窗縮放 // // 監聽視窗縮放
$(window).on('resize', function() { // $(window).on('resize', function() {
// 加上防抖 (Debounce) 可以讓效能更好,但若要即時反應可直接執行 // // 加上防抖 (Debounce) 可以讓效能更好,但若要即時反應可直接執行
handleNavMove(); // handleNavMove();
}); // });
}); // });
//header fixed在上方 //header fixed在上方
$(function(){ $(function(){
function initdata1(){ function initdata1(){
@ -2292,6 +2292,7 @@ $(function() {
// if($('.show-announcement').hasClass('show-announcement')) { // if($('.show-announcement').hasClass('show-announcement')) {
// $('.').css('', ''); // $('.').css('', '');
// } // }
$('.header-nav').append($('[accesskey="W"]'));
$(function() { $(function() {
var $headerNav = $('.header-nav'); var $headerNav = $('.header-nav');
$headerNav.contents().each(function() { $headerNav.contents().each(function() {
@ -3098,10 +3099,10 @@ $(document).ready(function() {
fixVideoPosterAlt(); fixVideoPosterAlt();
}); });
//網站導覽換icon //網站導覽換icon
// $(document).ready(function() { $(document).ready(function() {
// $('a[href="/zh_tw/sitemap"]').html('<i class="fa-solid fa-sitemap"></i>'); $('a[href="/zh_tw/sitemap"]').html('<i class="fa-solid fa-sitemap"></i>');
// $('a[href="/en/sitemap"]').html('<i class="fa-solid fa-sitemap"></i>') $('a[href="/en/sitemap"]').html('<i class="fa-solid fa-sitemap"></i>')
// }); });
//#tdstylesp表格樣式 //#tdstylesp表格樣式
$(function () { $(function () {
$('#tdstylesp').each(function () { $('#tdstylesp').each(function () {
@ -3784,6 +3785,33 @@ $(document).ready(function() {
} }
}); });
//中英切換紐 class用lang-switch
$(function() {
$('.lang-switch').on('click', function(e) {
e.preventDefault();
var lang = document.documentElement.lang;
var path = window.location.pathname;
var newUrl;
if (lang === 'en') {
// 英文 → 中文
if (path === '/' || path === '') {
newUrl = '/?locale=zh_tw';
} else {
newUrl = path.replace(/^\/en/, '/zh_tw');
}
} else {
// 中文 → 英文
if (path === '/' || path === '') {
newUrl = '/?locale=en';
} else {
newUrl = path.replace(/^\/zh_tw/, '/en');
}
}
window.location.href = newUrl;
});
});
}(jQuery, window)); }(jQuery, window));

View File

@ -67,9 +67,6 @@
.navbar-header{ .navbar-header{
// float: none!important; // float: none!important;
} }
}
.layout-content-box{
} }
.topcontent{ .topcontent{
z-index: 3; z-index: 3;
@ -102,6 +99,7 @@
} }
.layout-content { .layout-content {
position: relative; position: relative;
min-height: 70.5em;
.container { .container {
@extend .response-container; @extend .response-container;
} }

View File

@ -79,3 +79,17 @@
}); });
}); });
</script> </script>
<style type="text/css">
.w-ba-banner .controlplay .resume-slide.active i{
color: #32D9C3;
}
.w-ba-banner .controlplay .pause-slide.active i{
color: #ff4500;
}
.w-ba-banner .controlplay{
width: auto;
}
.next-button,.prev-button{
cursor: pointer;
}
</style>