blog/js/timeline.min.js

1 line
671 B (Stored with Git LFS)
JavaScript

jQuery(document).ready(function(i){function n(n,e){n.each(function(){i(this).offset().top>i(window).scrollTop()+i(window).height()*e&&i(this).find(".cd-timeline-img, .cd-timeline-content").addClass("is-hidden")})}function e(n,e){n.each(function(){i(this).offset().top<=i(window).scrollTop()+i(window).height()*e&&i(this).find(".cd-timeline-img").hasClass("is-hidden")&&i(this).find(".cd-timeline-img, .cd-timeline-content").removeClass("is-hidden").addClass("bounce-in")})}var t=i(".cd-timeline-block");const o=.8;n(t,o),i(window).on("scroll",function(){window.requestAnimationFrame?window.requestAnimationFrame(function(){e(t,o)}):setTimeout(function(){e(t,o)},100)})});