From dbf5798d6c7186eda19eedfe24694d2af08e1518 Mon Sep 17 00:00:00 2001 From: janraasch Date: Fri, 19 Mar 2021 02:30:18 +0000 Subject: [PATCH] deploy: 12321ef6918c2f5b0567756b9026594308c7fd0f --- js/index.js | 40 +++++++++++++++++++++++----------------- services/index.html | 2 +- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/js/index.js b/js/index.js index 2558e3b..fe53c5d 100644 --- a/js/index.js +++ b/js/index.js @@ -81,24 +81,30 @@ var $sitehead = $("#site-head"); } $post.each(function () { - var f = $(this).offset().top; - var b = $(this).offset().top + $(this).height(); - var t = $(this).parent(".post-holder").index(); - var i = $(".fn-item[item_index='" + t + "']"); - var a = $(this) - .parent(".post-holder") - .prev(".post-holder") - .find(".post-after"); - - $(this).attr("item_index", t); - - if (w >= f && w <= b) { - i.addClass("active"); - a.fadeOut("slow"); + if (($(window).height() + w) > ($(document).height() - $(".site-footer").height())) { + var l = $postholder.length; + $(".fn-item[item_index='" + (l - 1) + "']").removeClass("active") + $(".fn-item[item_index='" + (l) + "']").addClass("active") } else { - i.removeClass("active"); - a.fadeIn("slow"); - } + var f = $(this).offset().top; + var b = $(this).offset().top + $(this).height(); + var t = $(this).parent(".post-holder").index(); + var i = $(".fn-item[item_index='" + t + "']"); + var a = $(this) + .parent(".post-holder") + .prev(".post-holder") + .find(".post-after"); + + $(this).attr("item_index", t); + + if (w >= f && w <= b) { + i.addClass("active"); + a.fadeOut("slow"); + } else { + i.removeClass("active"); + a.fadeIn("slow"); + } + } }); }); } diff --git a/services/index.html b/services/index.html index f75af68..d30f66d 100644 --- a/services/index.html +++ b/services/index.html @@ -2,7 +2,7 @@ It carries a lot more detail than what I put on the homepage - I swear! You want to know what I can do for you? Well, let me tell ya! - Nutrition Coaching This is not an easy task. You will likely have to pay money for this. You know what - let us look at a nice picture first.">