From 82304f8c82dcc61c3e870c10ff8950aca84bc585 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 31 Aug 2021 15:25:53 +0800 Subject: [PATCH] fix style --- assets/javascripts/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js index 7d0f6cc..4af2a74 100644 --- a/assets/javascripts/app.js +++ b/assets/javascripts/app.js @@ -8,7 +8,9 @@ // if (location.href.search('editmode') == -1 && document.getElementsByClassName('asideright').length != 0) { if ( $('.header-banner').length != 0) { $('.layout-header').css('height', ''); - if ($(window).scrollTop() > 50) { /* 要滑動到選單的距離 */ + var scrollTop = $(window).scrollTop(); + var scrollBottom = $('html').height() - $(window).height() - scrollTop - $('.kenjohn').height(); + if (scrollTop>50 && scrollBottom>0) { /* 要滑動到選單的距離 */ $('.kenjohn').addClass('navFixed').removeClass('navRel'); /* 幫選單加上固定效果 */ } else { if ($('.header-banner').html().trim() == "") {