function open_sub_nav() { if (window.innerWidth <= 1024) { return; } const subContainerNav = document.querySelector('.sub-container-nav'); subContainerNav.classList.add('active'); } function close_sub_nav() { if (window.innerWidth <= 1024) { return; } const subContainerNav = document.querySelector('.sub-container-nav'); subContainerNav.classList.remove('active'); } const staticTop = document.querySelector('.navbar-static-top'); staticTop.addEventListener('mouseover', () => { open_sub_nav(); }); staticTop.addEventListener('mouseleave', () => { close_sub_nav(); }); window.addEventListener('resize', () => { if (window.innerWidth < 1024) { close_sub_nav(); } }); function adjustPadding() { const container = document.querySelector('.sub-container-nav'); const width = window.innerWidth; const getPaddingRight = () => { if (width > 1365) { return 320 - ((1920 - width) * (320 - 260)) / 120; } if (width > 1279) { return 92 + ((width - 1365) * (59.5 - 92)) / (1300 - 1365); } return 0; }; const paddingRight = getPaddingRight(); container.style.paddingRight = `${Math.max(paddingRight, 0)}px`; } // ÆäÀÌÁö ·Îµå ½Ã¿Í À©µµ¿ì ¸®»çÀÌÁî ½Ã¿¡ padding °ª Á¶Á¤ window.addEventListener('resize', adjustPadding); window.addEventListener('load', adjustPadding); $(document).ready(function () { $('.card-slider').slick({ autoplay: true, // ÀÚµ¿ Àç»ý Ȱ¼ºÈ­ autoplaySpeed: 3000, // 3Ãʸ¶´Ù º¯°æ (´ÜÀ§: ms) dots: true, // ³×ºñ°ÔÀÌ¼Ç Á¡ Ç¥½Ã arrows: true, // È­»ìÇ¥ ¼û±è infinite: true, // ¹«ÇÑ ¹Ýº¹ centerMode: true, // °¡¿îµ¥ Á¤·Ä ¸ðµå centerPadding: '0px', speed: 500, // Àüȯ ¼Óµµ slidesToShow: 3, // ÇÑ ¹ø¿¡ º¸ÀÌ´Â ½½¶óÀÌµå °³¼ö slidesToScroll: 1, // ÇÑ ¹ø¿¡ ³Ñ¾î°¡´Â ½½¶óÀÌµå °³¼ö responsive: [ { breakpoint: 1024, // 1024px ÀÌÇÏÀÏ ¶§ settings: { slidesToShow: 2 // 2°³ Ç¥½Ã } }, { breakpoint: 768, // 768px ÀÌÇÏÀÏ ¶§ (ÅÂºí¸´ & ¸ð¹ÙÀÏ) settings: { slidesToShow: 1, // 1°³ Ç¥½Ã arrows: false // ¸ð¹ÙÀÏ¿¡¼­ È­»ìÇ¥ Á¦°Å } } ] }); });