$(document).ready(function () { $("#gnb ul li p a").click(function () { $("html, body").animate({ scrollTop: $($.attr(this, "href")).offset().top - 100 }, 500); return false; }); var swiper = new Swiper('.swiper1', { loop: true, speed: 800, slidesPerView: 3, slidesPerGroup: 3, spaceBetween: 20, observer: true, observeParents: true, // If we need pagination pagination: { el: '.swiper-pagination', clickable: true, }, // Navigation arrows navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', } }); var swiper = new Swiper('.swiper2', { loop: true, speed: 800, slidesPerView: 3, slidesPerGroup: 3, spaceBetween: 20, observer: true, observeParents: true, // If we need pagination pagination: { el: '.swiper-pagination', clickable: true, }, // Navigation arrows navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', } }); $(window).load(function () { $('.flexslider').flexslider({ animation: "slide" }); }); $(".topnav").hover(function () { $(this).parent().find(".subnav").fadeIn('normal').show(); $(this).parent().hover(function () {}, function () { $(this).parent().find(".subnav").fadeOut('slow'); }); }); $('#back-top').click(function () { $('body,html').animate({ scrollTop: 0 }, 500); return false; }); var jbOffset = $('#gnb').offset(); $(window).scroll(function () { if ($(document).scrollTop() > jbOffset.top) { $('#gnb').addClass('jbFixed'); } else { $('#gnb').removeClass('jbFixed'); } }); lightGallery(document.getElementById('lightgallery'), { plugins: [lgZoom], licenseKey: 'your_license_key' }); lightGallery(document.getElementById('lightgallery2'), { plugins: [lgZoom], licenseKey: 'your_license_key' }); // 사람들 팝업 // 팝업 닫기 $('#popup .btn_close').click(function () { $(this).parent().fadeOut(300); $('.popup_back').fadeOut(300); document.body.classList.remove("stop-scroll"); }); }); // 사람들 팝업 //팝업 열기 function openModal(modalname,e) { document.get $("." + modalname).fadeIn(300); document.body.classList.add("stop-scroll"); } jQuery.fn.anchorAnimate = function (settings) { settings = jQuery.extend({ speed: 700, offset: 227 }, settings); return this.each(function () { var caller = this $(caller).click(function (event) { event.preventDefault() var locationHref = window.location.href var elementClick = $(caller).attr("href") var destination = $(elementClick).offset().top; $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination }, settings.speed, function () { window.location.hash = elementClick }); return false; }) }) } 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 != 11) { $("#gnb ul > li.hn" + page.hn + " a").addClass("on"); //1depth 활성 } if (page.hn >= 12) { $("#gnb ul > li.hn" + page.hn + " a").addClass("on"); //유틸 1depth 활성 } $(".snb ul li.sn" + page.sn).find(" a").addClass("on").end().find("> ul").addClass("on").find("> li.cn" + page.cn + " a").addClass("on"); //2depth 활성 } // $(function() { // var offset = $("#quick").offset(); // var topPadding = 80; // $(window).scroll(function() { // if ($(window).scrollTop() > offset.top) { // $("#quick").stop().animate({ // marginTop: $(window).scrollTop() - offset.top + topPadding // }, 500); // } else { // $("#quick").stop().animate({ // marginTop: 0 // }); // }; // }); // });