$(function(){ $("html").easeScroll({ frameRate: 60, animationTime: 1400, stepSize: 100, pulseAlgorithm: !0, pulseScale: 7, pulseNormalize: 1, accelerationDelta: 40, accelerationMax: 1, keyboardSupport: !0, arrowScroll: 50 }); let $animation_elements = $('.ani'); let $window = $(window); function check_if_in_view() { let window_height = $window.height(); let window_top_position = $window.scrollTop(); let window_bottom_position = (window_top_position + window_height); $.each($animation_elements, function() { let $element = $(this); let element_height = $element.outerHeight(); let element_top_position = $element.offset().top; let element_bottom_position = (element_top_position + (element_height / 2)); //check to see if this current container is within viewport if ((element_bottom_position >= window_top_position) && (element_top_position <= window_bottom_position)) { $element.addClass('in-view'); } else { //$element.removeClass('in-view'); } }); } $window.on('scroll resize', check_if_in_view); $window.trigger('scroll'); chkNum = 0; $(".this_page").on("click",function(){ if(chkNum == 0){ $(this).addClass("act"); $(this).next("ul").slideDown(); chkNum = 1; }else{ $(this).removeClass("act"); $(this).next("ul").slideUp(); chkNum = 0; } }) /* m18 */ $(window).scroll(function(){ let scroll = $(window).scrollTop(); let TopPosi = $(".m18 .history").offset().top; let headH = $("#header").height() + 60; if(scroll > TopPosi - headH){ $(".m18 .history .titlearea>div").addClass("act"); }else{ $(".m18 .history .titlearea>div").removeClass("act"); } }) })