From ec417d0bed31962bb69b3c4ee91e3e7f776d9eed Mon Sep 17 00:00:00 2001 From: ken Date: Mon, 27 Jul 2026 15:40:23 +0800 Subject: [PATCH] update --- .../template/modules/ad_banner.scss | 8 +++++--- .../stylesheets/template/widget/sitemenu.scss | 3 +++ modules/ad_banner/_ad_banner_widget1.html.erb | 19 +++++++++++++++++-- modules/ad_banner/_ad_banner_widget2.html.erb | 4 +++- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/assets/stylesheets/template/modules/ad_banner.scss b/assets/stylesheets/template/modules/ad_banner.scss index 05d20ae..7fdfcd9 100644 --- a/assets/stylesheets/template/modules/ad_banner.scss +++ b/assets/stylesheets/template/modules/ad_banner.scss @@ -30,9 +30,11 @@ ul.button-mid{ } } } -ul.button-mid{ - margin:0; - z-index: 201; +.button-mid { + position: absolute; + width: 100%; + height: 0; + top: 50%; } .banner-pager .active-slide button{ background: $theme-color-second!important; diff --git a/assets/stylesheets/template/widget/sitemenu.scss b/assets/stylesheets/template/widget/sitemenu.scss index 9a4013b..8f4d311 100644 --- a/assets/stylesheets/template/widget/sitemenu.scss +++ b/assets/stylesheets/template/widget/sitemenu.scss @@ -29,6 +29,7 @@ margin-right: 0.5em; margin-bottom: 0.5em; } + .sitemenu-link{ font-size: 1rem; font-weight: 900; position: relative; @@ -44,6 +45,8 @@ border:1px solid #6868688f; position: relative; padding: 0.5em 1em; + } + &:hover { background: #adb5bd33; diff --git a/modules/ad_banner/_ad_banner_widget1.html.erb b/modules/ad_banner/_ad_banner_widget1.html.erb index 72699e2..a5e36dd 100644 --- a/modules/ad_banner/_ad_banner_widget1.html.erb +++ b/modules/ad_banner/_ad_banner_widget1.html.erb @@ -20,7 +20,7 @@ data-cycle-title="{{title}}" data-cycle-desc="{{context}}" data-overlay-template="

{{title}}

{{desc}}

" - data-target="{{target}}" + data-bs-target="{{target}}" > @@ -65,7 +65,22 @@ }) $('[data-subpart-id="{{subpart-id}}"] .prev-button').click(function(){ $(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle("prev"); - }) + }); + /* 修正點:處理 Pager 無障礙朗讀文字 */ + $('.cycle-slideshow').on('cycle-post-initialize', function(event, optionHash) { + var $container = $(this).closest('.w-ba-banner'); + var $slides = $(this).find('.w-ba-banner__slide'); + var $pagerButtons = $container.find(".banner-pager button"); + + $pagerButtons.each(function(index) { + var slideTitle = $slides.eq(index).data('cycle-title') || ""; + var ariaLabel = "第 " + (index + 1) + " 張投影片 " + slideTitle; + $(this).attr({ + "aria-label": ariaLabel, + "title": ariaLabel + }); + }); + });