From 9040dfa51209c26c53b1e5bcc69e9af779cd195c Mon Sep 17 00:00:00 2001 From: rulingcom Date: Fri, 9 Dec 2022 17:48:31 +0800 Subject: [PATCH] Fix bug. --- assets/javascripts/app.js | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js index 3122141..ab2c4ac 100644 --- a/assets/javascripts/app.js +++ b/assets/javascripts/app.js @@ -11,35 +11,6 @@ this.replaceWith(new_html); } }); - function fix_first_element(reset_only) { - 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", ""); - if(!reset_only){ - 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 () { window.temp_scrollY = window.pageYOffset; window.temp_scrollX = window.pageXOffset; @@ -465,8 +436,6 @@ // 在所有的頁面(包含首頁)執行下面這幾個函數 window.has_topest_banner = ($('[data-pp="300"] .w-ad-banner').length != 0); initdata1(); - fix_first_element(); - window.setTimeout(fix_first_element, 3000); orbit.sitemenuDropdown(); orbit.goBackTop('top', 800); orbit.plugins.bullEye(); @@ -489,7 +458,6 @@ $(window).resize(function() { var navFixed = $('.kenjohn.navFixed'); window.top_barrier_height = (navFixed.length ? navFixed.height() : 0) + $('#orbit-bar').height(); - fix_first_element(); if ($(window).outerWidth() < 769) { if (resizeTimer) clearTimeout(resizeTimer); $('.outdropdowns').before($('.header-nav'));