// floating hide function checkOffset() { if ($('.floating').offset().top + $('.floating').height() >= $('#footer').offset().top - 100) $('.floating').css('opacity', '0'); if ($(document).scrollTop() + window.innerHeight < $('#footer').offset().top) $('.floating').css('opacity', '1'); } $(document).scroll(function() { checkOffset(); }); //counter var isAlreadyRun = false; $(window).scroll(function() { $('.area2').each(function(i) { var bottom_of_object = $(this).position().top + $(this).outerHeight() / 2; var bottom_of_window = $(window).scrollTop() + $(window).height(); if (bottom_of_window > (bottom_of_object + 20)) { if (!isAlreadyRun) { $('.count-number').each(function() { $(this).prop('Counter', 0).animate({ Counter: $(this).text() }, { duration: 2000, easing: 'swing', step: function(now) { $(this).text(Math.ceil(now)); } }); }); } isAlreadyRun = true; } }); }); //slide var swiper = new Swiper(".mainSlide", { spaceBetween: 30, effect: "fade", loop: true, speed: 2000, autoplay: { delay: 2500, disableOnInteraction: false, }, pagination: { el: ".swiper-pagination", clickable: true, }, });