$(document).ready(function () { // ********** 메뉴 ********** $('nav > ul > li').mouseover(function () { $(this).children('.subnav').stop().slideDown(); }); $('nav > ul > li').mouseleave(function () { $(this).children('.subnav').stop().slideUp(); }); // ********** 메뉴 스크롤 효과 ********** var path = window.location.pathname; var page = path.split('/').pop(); var isMainPage = page === '' || page === 'index.html' || page === 'index.php'; // 메인 페이지에서만 스크롤 효과 if (isMainPage) { $(window).scroll(function () { const scroll_top = $(this).scrollTop(); if (scroll_top >= 50) { $("header").addClass("on"); } else { $("header").removeClass("on"); } }); } else { // 서브페이지는 항상 on 클래스 유지 $("header").addClass("on"); } // ********** section3 ********** var Swiper1 = new Swiper('.s3Swiper', { loop: true, speed: 900, observer: true, loopedSlides: 4, slidesPerView: 1.5, spaceBetween: 40, autoplay: { delay: 2500, disableOnInteraction: false }, navigation: { nextEl: "#section3 .swiper-button-next", prevEl: "#section3 .swiper-button-prev", }, pagination: { el: "#section3 .swiper-pagination", clickable: true, }, }); // ********** section6 ********** var Swiper2 = new Swiper('.s6Swiper', { loop: true, speed: 900, observer: true, loopedSlides: 3, slidesPerView: 1, spaceBetween: 10, autoplay: { delay: 2500, disableOnInteraction: false }, navigation: { nextEl: "#section6 .swiper-button-next", prevEl: "#section6 .swiper-button-prev", }, }); // ********** section7 ********** var Swiper3 = new Swiper('.s7Swiper', { loop: true, speed: 900, observer: true, loopedSlides: 3, slidesPerView: 1, spaceBetween: 10, autoplay: { delay: 2500, disableOnInteraction: false }, pagination: { el: "#section7 .swiper-pagination", clickable: true, }, }); // ********** sub104 둘러보기 ********** // 하단 슬라이드 var swiper4 = new Swiper(".sub104 .mySwiper", { spaceBetween: 20, slidesPerView: 7, centeredSlides: true, freeMode: true, watchSlidesProgress: true, slideToClickedSlide: true, on: { click: function (swiper, event) { // 클릭한 슬라이드를 중앙으로 swiper.slideTo(swiper.clickedIndex); } } }); var swiper5 = new Swiper(".sub104 .mySwiper2", { spaceBetween: 10, navigation: { nextEl: "#sub104_arrow .swiper-button-next", prevEl: "#sub104_arrow .swiper-button-prev", }, thumbs: { swiper: swiper4, }, on: { slideChange: function () { swiper4.slideTo(this.activeIndex); } } }); // end }); // **************************************** function setPage(arg) { //navigation hn:1depth, sn:2depth, cn:3depth 를 받음 page = jQuery.extend({ hn: "", sn: "", cn: "" }, arg || {}); if (window.console) { console.log("hn : " + page.hn + "\nsn : " + page.sn + "\ncn : " + page.cn); } if (page.hn != 10) { $(".hn" + page.hn + " a").addClass("on"); //1depth 활성 } if (page.hn >= 11) { $(".hn" + page.hn + " a").addClass("on"); //하단 1depth 활성 } $(".hn" + page.hn + "> .subnav li.sn" + page.sn).addClass("on").end().find("> ul").addClass("on").find("> li.cn" + page.cn + " a").addClass("on"); //2depth 활성 $(".snb .snb_pc li.sn" + page.sn).addClass("on").end().find("> ul").addClass("on").find("> li.cn" + page.cn + " a").addClass("on"); //2depth 활성 }