From 6a4380801f658ab6effb92bec63a24811e38e264 Mon Sep 17 00:00:00 2001 From: rulingcom Date: Sun, 14 Nov 2021 03:33:54 +0000 Subject: [PATCH] fix error --- assets/javascripts/app.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js index edcd237..8a7f4a6 100644 --- a/assets/javascripts/app.js +++ b/assets/javascripts/app.js @@ -11,7 +11,7 @@ var scrollTop = $(window).scrollTop(); var scrollBottom = $('html').height() - $(window).height() - $('.kenjohn').height(); if (scrollTop>5 && scrollBottom>0) { /* 要滑動到選單的距離 */ - if (parseInt($('.layout-content').css('margin-top'))==0){ + if (parseInt($('.layout-content').css('margin-top'))==0 && $('.layout-content.topcontent').offset().top<400){ $('.layout-content').css('margin-top',$('.kenjohn').height()-$('#orbit-bar').height()); } $('.kenjohn').addClass('navFixed').removeClass('navRel'); /* 幫選單加上固定效果 */ @@ -713,6 +713,11 @@ function transdate(){ // 當文件物件模型(DOM)載入後,執行init函數 $(document).ready(function() { + $('.group').each(function(){ + if ($(this).text().trim()==''){ + $(this).css('padding',0); + } + }); //RWD 自動縮放headerbannner function headerH() { if ($(window).outerWidth() < 769) { @@ -827,7 +832,9 @@ function transdate(){ var theTop; if (stop){ $(".kenjohn").addClass('navFixed'); - $('.layout-content').css('margin-top',$('.kenjohn').height()-$('#orbit-bar').height()); + if ($('.layout-content.topcontent').offset().top<400){ + $('.layout-content').css('margin-top',$('.kenjohn').height()-$('#orbit-bar').height()); + } if (parseInt($('.layout-content').css('margin-top')==0)){ theTop = $('.layout-content-inner.container').offset().top-$(".kenjohn").position().top+10; }else{