This commit is contained in:
rulingcom 2022-12-15 15:37:24 +08:00
parent 5d7c71da9f
commit 0c42e6f81a
2 changed files with 38 additions and 7 deletions

View File

@ -11,6 +11,33 @@
this.replaceWith(new_html); this.replaceWith(new_html);
} }
}); });
function fix_first_element() {
if (!window.has_topest_banner) {
$('.downIcon').css('display','none');
var first_element = $('.header-banner');
if(first_element.length == 0){
first_element = $('.layout-content .layout-content-inner').eq(0);
}else{
if(first_element.html() == ''){
first_element = $('.layout-content .layout-content-inner').eq(0);
}
}
if(first_element.length != 0){
first_element.css("margin-top", "");
var ele_offset = first_element[0].getBoundingClientRect().top;
if(first_element.parents('.kenjohn.navFixed').length == 0)
ele_offset -= window.top_barrier_height;
if(ele_offset < 0){
first_element.css("margin-top", -ele_offset + "px");
}else{
first_element.css("margin-top", "");
}
}
}else{
$("#onesection").css("margin", "0");
$('.layout-content-inner .row, .layout-content-inner .row > [class*="col-"]').css("padding", "0");
}
}
function initdata1 () { function initdata1 () {
window.temp_scrollY = window.pageYOffset; window.temp_scrollY = window.pageYOffset;
window.temp_scrollX = window.pageXOffset; window.temp_scrollX = window.pageXOffset;
@ -23,7 +50,7 @@
$('.layout-header').css('height', ''); $('.layout-header').css('height', '');
var scrollTop = $(window).scrollTop(); var scrollTop = $(window).scrollTop();
if (!window.has_topest_banner){ if (!window.has_topest_banner){
$('.kenjohn').removeClass('navFixed').addClass('navRel'); /* 正常選單固定效果 */ $('.kenjohn').removeClass('navRel').addClass('navFixed'); /* 正常選單固定效果 */
}else if (scrollTop>5) { /* 要滑動到選單的距離 */ }else if (scrollTop>5) { /* 要滑動到選單的距離 */
if (parseInt($('.layout-content').css('margin-top'))==0 && $('.layout-content.topcontent').length != 0 && $('.layout-content.topcontent').offset().top<400){ if (parseInt($('.layout-content').css('margin-top'))==0 && $('.layout-content.topcontent').length != 0 && $('.layout-content.topcontent').offset().top<400){
$('.layout-content').css('margin-top',$('.kenjohn').height()-$('#orbit-bar').height()); $('.layout-content').css('margin-top',$('.kenjohn').height()-$('#orbit-bar').height());
@ -447,6 +474,7 @@
// 在所有的頁面(包含首頁)執行下面這幾個函數 // 在所有的頁面(包含首頁)執行下面這幾個函數
window.has_topest_banner = ($('[data-pp="300"] .w-ad-banner').length != 0); window.has_topest_banner = ($('[data-pp="300"] .w-ad-banner').length != 0);
initdata1(); initdata1();
fix_first_element();
orbit.sitemenuDropdown(); orbit.sitemenuDropdown();
orbit.goBackTop('top', 800); orbit.goBackTop('top', 800);
orbit.plugins.bullEye(); orbit.plugins.bullEye();
@ -470,6 +498,7 @@
$(window).resize(function() { $(window).resize(function() {
var navFixed = $('.kenjohn.navFixed'); var navFixed = $('.kenjohn.navFixed');
window.top_barrier_height = (navFixed.length ? navFixed.height() : 0) + $('#orbit-bar').height(); window.top_barrier_height = (navFixed.length ? navFixed.height() : 0) + $('#orbit-bar').height();
fix_first_element();
if ($(window).outerWidth() >200) { if ($(window).outerWidth() >200) {
if (resizeTimer) clearTimeout(resizeTimer); if (resizeTimer) clearTimeout(resizeTimer);
$('.outdropdowns').before($('.header-nav')); $('.outdropdowns').before($('.header-nav'));

View File

@ -26,9 +26,11 @@
} }
.ad-banner-widget-6{ .ad-banner-widget-6{
.w-ad-banner__caption a{ .w-ad-banner__caption a{
display: block; display: block;
width: 100%; width: 100%;
height: 100%; height: 100%;
color: inherit;
padding: 1em;
} }
} }
.w-ba-banner__wrap { .w-ba-banner__wrap {
@ -254,7 +256,7 @@ ul.button-mid{
color: #333333; color: #333333;
} }
.w-ba-banner__caption { .w-ba-banner__caption {
color: $theme-color-main; color: #fff;
z-index: 200; z-index: 200;
background-image: none; background-image: none;
padding:2em 11% 4em; padding:2em 11% 4em;
@ -296,7 +298,7 @@ ul.button-mid{
height: 100%; height: 100%;
} }
.w-ba-banner__caption { .w-ba-banner__caption {
color: $theme-color-main; color: #fff;
z-index: 200; z-index: 200;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -441,7 +443,7 @@ ul.button-mid{
.ba-banner-widget-1 { .ba-banner-widget-1 {
.w-ba-banner__caption { .w-ba-banner__caption {
color: $theme-color-main; color: #fff;
z-index: 200; z-index: 200;
h2 { h2 {