$(document).ready(function () { // header °íÁ¤ $(window).on('scroll', function () { if ($(window).scrollTop()) { $('.header_main').addClass('active'); $(".header_main .hd_logo img").attr("src", "/base/img/batwo/logo.png"); } else { $('.header_main').removeClass('active'); $(".header_main .hd_logo img").attr("src", "/base/img/batwo/logo_white.png"); } }); // ¸ð¹ÙÀÏ ½½¶óÀÌµå ¸Þ´º $('.m_menu').on('click', function () { $(this).toggleClass('on'); $('.aside').toggleClass('on'); $('.aside_bg').toggleClass('on'); }); // ½ºÅ©·Ñ ¹öư $(".btn_scroll").click(function () { // Ŭ¸¯ ½Ã #scroll_move·Î ºÎµå·´°Ô ½ºÅ©·Ñ À̵¿ÇÕ´Ï´Ù. $('html, body').animate({ scrollTop: $("#scroll_move").offset().top }, 0); // ½ºÅ©·Ñ ¼Óµµ¸¦ Á¶ÀýÇÒ ¼ö ÀÖ½À´Ï´Ù. 1000Àº 1Ãʸ¦ ÀǹÌÇÕ´Ï´Ù. }); // tab $(".tab_btn li").click(function () { var idx = $(this).index(); $(".tab_btn li").removeClass("on"); $(".tab_btn li").eq(idx).addClass("on"); $(".tab_content > div").removeClass("on"); $(".tab_content > div").eq(idx).addClass("on"); }) //Ä«¿îÆ®´Ù¿î // ¾Ö´Ï¸ÞÀ̼ÇÀ» ½ÇÇàÇÒ ÇÔ¼ö function runCountAnimation() { $('.countAni').each(function () { const $this = $(this), countTo = $this.attr('data-count'); $({ countNum: $this.text() }).animate({ countNum: countTo }, { duration: 2000, easing: 'linear', step: function () { $this.text(Math.floor(this.countNum)); }, complete: function () { $this.text(this.countNum.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')); } }); }); } // Intersection Observer ¼³Á¤ const countSection = document.getElementById('countSection'); const observer = new IntersectionObserver((entries, observer) => { entries.forEach(entry => { if (entry.isIntersecting) { // ¼½¼ÇÀÌ È­¸é¿¡ º¸ÀÌ¸é ¾Ö´Ï¸ÞÀÌ¼Ç ½ÇÇà runCountAnimation(); // °üÂûÀ» ¸ØÃã (ÇÑ ¹ø¸¸ ½ÇÇàµÇµµ·Ï) observer.unobserve(entry.target); } }); }, { threshold: 0.5 }); // º¯°æ °¡´ÉÇÑ threshold °ª // ¼½¼ÇÀ» °üÂû ½ÃÀÛ observer.observe(countSection); });