,並移動到 .video_group_time 內部 var $q = $this.closest(".imglst_desc").find(".movie_desc q"); if ($q.length) { @@ -896,22 +1064,8 @@ $(document).ready(function () { clearInterval(interval); } }, 1000); - }); - - // 當文件物件模型(DOM)載入後,執行init函數 - $(document).ready(function() { - // 綁定滑動事件 - $(".cycle-slideshow").swipe({ - swipeLeft: function () { - $(this).cycle("next"); // 向左滑動,切換到下一張 - }, - swipeRight: function () { - $(this).cycle("prev"); // 向右滑動,切換到上一張 - }, - threshold: 50, // 滑動靈敏度(數值越小越敏感) - }); - //改變日期格式 - $(".video_group_time").each(function () { + //改變日期格式 + $(".video_group_time").each(function () { var $this = $(this); var originalText = $this.text().trim(); // 把 YYYY-MM-DD 轉換成 M月D日 @@ -923,6 +1077,87 @@ $(document).ready(function () { // 更新內容並加上$this.html(formattedText).append($q); }); + +}); + +$(document).ready(function () { + $('.rucaptcha-image').removeAttr('onload'); + + // 檢查是否已插入過 + if (!$('#captcha_audio').length) { + const audioButton = $(` + + `); + + const audio = $(''); + + $('.rucaptcha-image').after(audioButton, audio); + } +}); + +//萬用表格searchbtn2 +$(document).ready(function () { + $('.searchbtn2').click(function (event) { + event.preventDefault(); // 防止預設行為 + $(".searchbox").slideToggle(300, function () { + updateAriaExpanded(); + }); + $(this).closest('.ken-click').toggleClass('ken-click2'); + }); + + let triggeredByFocus = false; + + function updateAriaExpanded() { + const isVisible = $(".searchbox").is(":visible"); + $(".searchbtn2").attr("aria-expanded", isVisible ? "true" : "false"); + } + + // 預設 aria-expanded 為 false + $(".searchbtn2").attr("aria-expanded", "false"); +}); + +// 當文件物件模型(DOM)載入後,執行init函數 +$(document).ready(function() { + $('a').each(function () { + const $a = $(this); + + // 有圖示或圖片就不刪 + if ($a.find('i, img').length > 0) return; + + // 沒有任何實際文字內容(去除空白) + const hasVisibleText = $a.text().trim().length > 0; + + // 進一步判斷 span 內部是否完全為空 + const allChildrenEmpty = $a.children().length > 0 && $a.children().toArray().every(child => { + return $(child).text().trim().length === 0; + }); + + // 如果沒有文字內容且子元素全為空,則移除 + if (!hasVisibleText && allChildrenEmpty) { + $a.remove(); + } + }); + $('.i-member-pic-wrap a').removeAttr('target'); + function markCheckStatusButton() { + $('.ask-question').each(function () { + var $prev = $(this).prev(); // 取得前一個元素 + + // 如果前一個元素是 且 class 包含 "btn" + if ($prev.is('a') && $prev.hasClass('btn')) { + $prev.addClass('CheckStatus'); // 加上 class + } + }); + }; + markCheckStatusButton(); //常用到的js // $('.').after($('.')); // $('.').before($('.')); @@ -930,6 +1165,19 @@ $(document).ready(function () { // if($('.show-announcement').hasClass('show-announcement')) { // $('.').css('', ''); // } + + // 綁定滑動事件 + $(".cycle-slideshow").swipe({ + swipeLeft: function () { + $(this).cycle("next"); + }, + swipeRight: function () { + $(this).cycle("prev"); + }, + threshold: 50, // 滑動靈敏度(數值越小越敏感) + }); + + $('#check_history_form input[type="submit"][value="Check History"]').addClass('CheckHistory'); $(".mybooking").append(''); //內頁dattpp移位 $('.i-annc__page-title').after($('.sitemenu-wrap2')); @@ -938,12 +1186,9 @@ $(document).ready(function () { $('.box-social-share').before($('.sitemenu-wrap3')); $('.box-social-share').before($('.sitemenu-wrap3')); $('.box-social-share').before($('.sitemenu-wrap3')); - $(".member-data2-tr").before($(".show-member .table-striped > tbody > tr:nth-of-type(4)")); $(".nav-pills").before($(".show-member .table-striped > tbody > tr:last-child")); - - //檔案室手風琴 $('.panel-title>.collapsed').click(function(){ $(this).find('.fa').toggleClass("fa-chevron-down"); @@ -995,11 +1240,6 @@ $(document).ready(function () { }else{ $('.outdropdowns').before($('.header-nav')); }; - // - $(".ken-click").click(function(){ - $(".searchbox").slideToggle(300); - $('.ken-click').toggleClass('ken-click2'); - }); $('.sitemenu-vertical .sitemenu-dropdown-toggle').click(function(){ $('.sitemenu-vertical .dropdown-menu').slideToggle(); $(".sitemenu-vertical .sitemenu-dropdown-toggle").toggleClass("fa-caret-down"); @@ -1020,7 +1260,6 @@ $(document).ready(function () { $('.list-unstyled>li:nth-child(n+5)').slideToggle(); $(".morebken .fa-chevron-down").toggleClass("rotate"); $(".openmorebken").toggleClass("closemorebken"); - }); //RWD 自動縮放headerbannner function headerH() { @@ -1094,91 +1333,172 @@ $(document).ready(function () { // $('.outdropdowns').removeClass('navFixed'); /* 移除選單固定效果 */ // } // }); - $('.navbar-brand h2').replaceWith(function() { - return $("", { - class: this.className, - html: $(this).html() - }); - }); + // $('.navbar-brand h2').replaceWith(function() { + // return $("
", { + // class: this.className, + // html: $(this).html() + // }); + // }); $('#search'). attr('title', '另開新視窗'); - $(window).scroll(function() { - var windowBottom = $(window).scrollTop() + $(window).innerHeight(); - $('.hide0').each(function() { - var mid = $(this).offset().top + $(this).height()/2; - if( mid < windowBottom && mid > $(window).scrollTop()){ - $(this).addClass('animationvisible') - } else { - $(this).removeClass('animationvisible') - } - }) - $('.hide1').each(function() { - var mid = $(this).offset().top + $(this).height()/2; - if( mid < windowBottom && mid > $(window).scrollTop()){ - $(this).addClass('animationvisible1') - } else { - $(this).removeClass('animationvisible1') - } - }) - $('.hide2').each(function() { - var mid = $(this).offset().top + $(this).height()/2; - if( mid < windowBottom && mid > $(window).scrollTop()){ - $(this).addClass('animationvisible2') - } else { - $(this).removeClass('animationvisible2') - } - }) - $('.hide3').each(function() { - var mid = $(this).offset().top + $(this).height()/2; - if( mid < windowBottom && mid > $(window).scrollTop()){ - $(this).addClass('animationvisible3') - } else { - $(this).removeClass('animationvisible3') - } - }) - $('.rotate0').each(function() { - var mid = $(this).offset().top + $(this).height()/2; - if( mid < windowBottom && mid > $(window).scrollTop()){ - $(this).addClass('animationrotate0') - } else { - $(this).removeClass('animationrotate0') - } - }) - $('.zoomin').each(function() { - var mid = $(this).offset().top + $(this).height()/2; - if( mid < windowBottom && mid > $(window).scrollTop()){ - $(this).addClass('animationvisible5') - } else { - $(this).removeClass('animationvisible5') - } - }) - }) + $(window).scroll(function () { + var windowTop = $(window).scrollTop(); + var windowBottom = windowTop + $(window).innerHeight(); + + function handleAnimationOnce(selector, animationClass, offsetRatio = 0.5) { + $(selector).each(function () { + var elementTop = $(this).offset().top; + var elementHeight = $(this).height(); + var triggerPoint = elementTop + elementHeight * offsetRatio; + + if ( + triggerPoint >= windowTop && + triggerPoint <= windowBottom && + !$(this).hasClass(animationClass) + ) { + $(this).addClass(animationClass); + } + }); + } + + handleAnimationOnce('.hide0', 'animationvisible', 0.1); + handleAnimationOnce('.hide1', 'animationvisible1', 0.5); + handleAnimationOnce('.hide2', 'animationvisible2', 0.5); + handleAnimationOnce('.hide3', 'animationvisible3', 0.5); + handleAnimationOnce('.rotate0', 'animationrotate0', 0.5); + handleAnimationOnce('.zoomin', 'animationvisible5', 0.5); + }); + init(); +}); + +//orbitbar無障礙js +$(document).ready(function() { + const isEnglish = document.documentElement.lang === 'en'; + + if (isEnglish) { + $('.navbar-toggle').attr({ + title: 'menu', + 'aria-label': 'menu' + }); + $('label[for="open-orbit-nav"]').attr({ + title: 'Site search and language menu', + 'aria-label': 'Site search and language menu' + }); + $('.mobile-button').attr({ + title: 'Language menu', + 'aria-label': 'Language menu' + }); + } else { + $('label[for="open-orbit-nav"]').attr({ + title: '全站収尋及語言切換選單', + 'aria-label': '全站収尋及語言切換選單' + }); + $('.mobile-button').attr({ + title: '語言切換選單', + 'aria-label': '語言切換選單' + }); + } + + + $('label[for="open-orbit-login"]').removeAttr('tabindex'); + $('#orbit-bar').find('li').each(function() { + var $li = $(this); + + // 如果
中没有 元素,则为 设置 tabindex="0" + if ($li.children('a').length === 0) { + $li.attr('tabindex', '0'); + } else { + // 如果 中有 元素,则确保 有 tabindex="0" + $li.find('a').attr('tabindex', '0'); + + // 确保 不影响焦点管理,移除 的 tabindex + $li.removeAttr('tabindex'); + + // 如果 被聚焦,自动跳转到 元素 + $li.on('focus', function() { + $(this).find('a').focus(); + }); + } }); + $('label[for="open-orbit-nav"]').attr('tabindex', '0'); + // 当屏幕宽度小于 768px 时,将 .orbit-bar-search-sign-language 移动到