var laptopWidth = 1366; var tabletWidth = 1280; // 헤더가 변경되는 시점 var mobileWidth = 800; $(window).on("load", function () { toAnchorParameter("anchor"); /* 주소~?anchor=content */ }); $(function () { ScrollTrigger.matchMedia({ "(min-width: 768px)": function () { if ($.exists(".extend-banner-con")) { const inverterMotion = gsap.timeline({ scrollTrigger: { trigger: ".sub-content", start: "top 50%", end: "bottom bottom", engTrigger: ".greeting-con", } }); inverterMotion.to(".extend-banner-con", { delay: 0, x: 0, y: 0, top: 0, width: '100%', }); } } }) /* 서브페이지에 탭 넣을 때 참고 ( 클래스 명 주의 )*/ $(".cm-4dep-tab-con li").click(function () { if ($(this).find("span").attr("data-name") == "QNM") { rollingItem() } var index = $(this).index(); $(".cm-4dep-tab-con li").removeClass("active") $(this).addClass("active"); $(".cm-tab-con").hide() $(".cm-tab-con").eq(index).fadeIn(); }) /* 서브페이지에 슬라이드 넣을 때 참고 ( 클래스 명 주의 ) */ $(".micro-slide").each(function(){ var $microSlide = $(this); var $microSlideItem = $(this).find(".slide-item"); $microSlide.slick({ slidesToShow:1, arrows:false, dots:true, infinite: true, fade:true, // prevArrow: ".micro-controls .prev-btn", // nextArrow: ".micro-controls .next-btn", }) }) function rollingItem() { $(".rolling-list").each(function () { const $itemList = $(this); const $item = $itemList.find(".rolling-item"); const $itemLength = $item.length; let startNum = 0; console.log($itemLength) function test() { if (startNum < ($itemLength - 1)) { startNum++; } else { startNum = 0; } play() } function play() { $item.each(function (id) { if (id == startNum) { $(this).addClass("active") } else { $(this).removeClass("active") } }) } setInterval(test, 2000); }) } }) // $(window).on("load", function (e) { // if ($.exists("#subVisual")) { // window.addEventListener( // "scroll", // toFit(function () {}, {}), // { passive: true } // ); // var wheel_move; // var isPassive = function () { // var passiveSupported = false; // try { // document.addEventListener("test", null, { // get passive() { // passiveSupported = true; // }, // }); // } catch (e) {} // return passiveSupported; // }; // var windowHeightCheck = function () { // return $(window).scrollTop(); // }; // var scrollStop = function (event) { // event.preventDefault(); // event.stopPropagation(); // return false; // }; // var browserWheelStop = function () { // if (isPassive()) { // this.addEventListener("wheel", scrollStop, { passive: false }); // } else { // $("body").on("scroll touchmove mousewheel", scrollStop); // } // }; // if (getScrollBarWidth() > 0) { // var checkWidth = getWindowWidth() - getScrollBarWidth(); // } else { // var checkWidth = getWindowWidth(); // } // if (tabletWidth >= checkWidth) { // if (mobileWidth < checkWidth) { // var $section1_top = $("#subContent").offset().top - $("#header").height(); // } else { // var $section1_top = $("#subContent").offset().top - $("#header").height() - $("#topMenuM").height(); // } // } else { // var $section1_top = $("#subContent").offset().top; // } // if (windowHeightCheck() === 0) { // browserWheelStop(); // } // $(".textareainfo").mouseover(function () { // $("body").on("scroll touchmove mousewheel", scrollStop); // }); // $("#subVisual").on("mousewheel DOMMouseScroll", function (e, delta) { // e.preventDefault(); // if (getScrollBarWidth() > 0) { // var checkWidth = getWindowWidth() - getScrollBarWidth(); // } else { // var checkWidth = getWindowWidth(); // } // if (tabletWidth >= checkWidth) { // if (mobileWidth < checkWidth) { // var $section1_top = $("#subContent").offset().top - $("#header").height(); // } else { // var $section1_top = $("#subContent").offset().top - $("#header").height() - $("#topMenuM").height(); // } // } else { // var $section1_top = $("#subContent").offset().top; // } // if (delta < 0) { // // down // moveScrollContent($section1_top, true); // return; // } else { // //up // moveScrollContent(0, false); // } // }); // $("#subContent").on("mousewheel DOMMouseScroll", function (e, delta) { // if (isPassive()) { // window.removeEventListener("wheel", scrollStop, { passive: false }); // } else { // $("body").off("scroll touchmove mousewheel", scrollStop); // } // }); // function moveScrollContent(top, scrollState) { // if (wheel_move && wheel_move.progress() < 1) { // return; // } // wheel_move = TweenMax.to("html, body", 0.65, { // scrollTop: top, // ease: Expo.easeInOutCubic, // onComplete: function () { // if (scrollState) { // if (isPassive()) { // window.removeEventListener("wheel", scrollStop, { // passive: false, // }); // } else { // $("body").off("scroll touchmove mousewheel", scrollStop); // } // } // }, // }); // } // } // });