Sha256: 9257e0dbcf6ab34ae6db70575828edf0487b258f18b8eb663dcec017249943cc
Contents?: true
Size: 1.23 KB
Versions: 13
Compression:
Stored size: 1.23 KB
Contents
/* # ----------------------------------------------------------------------------- # ~/assets/themes/j1/modules/showOnScroll/js/showOnScroll.min.js # J1 implementation for showOnScroll # # Product/Info: # https://jekyll.one # # Copyright (C) 2021 Juergen Adams # # J1 Template is licensed under the MIT License. # For details, see https://jekyll.one # ----------------------------------------------------------------------------- */ function isInViewport(g,f){if(g.length==0){return}var c=jQuery(window);var j=c.scrollTop();var b=c.height();var d=j+b;var e=jQuery(g);var h=e.offset().top+f;var i=e.height();var a=h+i;return(h>=j&&h<d)||(a>j&&a<=d)||(i>b&&h<=j&&a>=d)}$(document).ready(function(){var a=700;var e=500;var b=log4javascript.getLogger("j1.core.showOnScroll");var c=function(f){if(isInViewport($("#home_service_panel"),e)){b.info("\nThe specified container is in view: home_service_panel");$(".home_service_panel").show(a);window.removeEventListener("scroll",c)}};window.addEventListener("scroll",c);var d=function(f){if(isInViewport($("#home_intro_panel"),e)){b.info("\nThe specified container is in view: home_intro_panel");$(".home_intro_panel").show(a);window.removeEventListener("scroll",d)}};window.addEventListener("scroll",d)});
Version data entries
13 entries across 13 versions & 1 rubygems