/*******************************/ /* Publisher olibu. Front-js.js */ /*******************************/ //GNB Mouse on,oveer $(document).ready(function() { // gnb 메뉴 $(".gnb nav > ul > li > a").on("mouseover focusin",function(){ if($(this).parent("li").hasClass("on")){ $(this).removeClass("on"); }else{ $(".gnb nav > ul > li.on").each(function() { $(this).removeClass("on"); }); } $(this).parent("li").addClass("on"); //$(".two-depth-bg").show(); }); $(".two-depth").mouseleave(function(){ $(".gnb nav > ul > li").removeClass("on"); //$(".two-depth-bg").hide(); }); $(".gnb nav > ul > li.off > a").on("mouseleave focusin",function(){ $(".gnb nav > ul > li").removeClass("on"); }); //하위메뉴 없을시 추가 //$(".gnb nav > ul > li.off > a").on("mouseover focusin",function(){ //$(".two-depth").hide(); //}); //하위메뉴 없을시 추가 end $(".gnb nav ul > li").each(function(){ if ($(this).children("a").text() == $(".sub-nav").text() ){ $(this).children("a").css("color","rgba(255,255,255,.8)"); $(this).children("a").css("border-bottom","1px solid #fff"); } }); //GNB Mouse on,oveer end // 스크롤 앵커이동 $('a.ps').click(function(){ $('html, body').animate({ scrollTop: $( $.attr(this, 'href') ).offset().top -20 }, 500); return false; }); /** 스크롤이 설정한 높이 이상 내려갔을때 quickWrap 스타일추가하기*/ if (jQuery(window).width() > 0) { jQuery(window).on("scroll",function(ev){ if(jQuery(window).scrollTop() > 100 ) { /**높이 픽셀 조정**/ jQuery('.quickWrap').addClass('quick_top'); } else{ jQuery('.quickWrap').removeClass('quick_top'); } return false; }); } if (jQuery(window).width() > 0) { jQuery(window).on("scroll",function(ev){ if(jQuery(window).scrollTop() > 100 ) { /**높이 픽셀 조정**/ jQuery('.quickSub').addClass('quick_top'); } else{ jQuery('.quickSub').removeClass('quick_top'); } return false; }); } /* 위로 스크롤이 특정 위치로 이동하면 위로버튼이 나타난다. 위로버튼을 클릭하면 상단으로 이동 */ function btn_mv_up(oj) { if(!oj) return false; var o = $(oj); var p = $(window).scrollTop(); if(p > 300){ o.fadeIn('slow'); } // 위로버튼이 나타나는 위치 지정 else if(p < 300){ o.fadeOut('slow'); } // 위로버튼을 숨기는 위치 지정 } // 위로 버튼 $(document).scroll(function() { btn_mv_up('.btn_up_layer'); }).on('click', '.btn_up_layer', function() { $("html, body").animate({scrollTop:0}, 'slow'); }); /* 모바일 바디 스크롤방지 */ var posY; $(".mOpener").on("click", function(e){ posY = $(window).scrollTop(); $("html, body").addClass("not_scroll"); $(".mMenu").css("display","block"); //$(".cont").css("top",-posY); }); $(".closer").on("click", function(){ $("html, body").removeClass("not_scroll"); // $(".mMenu").css("display","none"); posY = $(window).scrollTop(posY); }); $(".mask").on("click", function(){ $("html, body").removeClass("not_scroll"); // $(".mMenu").css("display","none"); posY = $(window).scrollTop(posY); }); /* 모바일 바디 스크롤방지 end */ /* *********************** 서브페이지 ON ************************ */ setTimeout(function () { $("#visual").addClass("active"); }); /* slide JS */ /* slide new ver - mainImg */ $('.slider').slick({ // fade: true, autoplay: true, autoplaySpeed: 5000, speed: 800, lazyLoad: 'progressive', arrows: false, dots: true, pauseOnHover:false, // 마우스 오버시 슬라이드 이동 멈춤 }).slickAnimation(); /* roll_partner */ var swiper = new Swiper('#roll_partner', { //pagination: { // el: '.swiper_s1 .swiper-pagination', // clickable: true, // }, // navigation: { // nextEl: '.swiper_s1 .swiper-button-next', // prevEl: '.swiper_s1 .swiper-button-prev', // }, slidesPerView: 'auto', //화면에 보여질 슬라이드 갯수 spaceBetween: 40, loop: true, autoplay: { delay: 4000, speed: 500, disableOnInteraction: false, }, breakpoints: { 768: { // slidesPerView: 'auto', spaceBetween: 60, }, // 768: { // slidesPerView: 3, // spaceBetween: 20, // }, //1220: { // slidesPerView: 4, // spaceBetween: 20, // }, //1600: { // slidesPerView: 6, // spaceBetween: 20, // }, } }); // 1개롤링 /* slide JS end */ /* tab */ //Default Action $(".tab_mcontent").hide(); //Hide all content $(".main_tab li:first").addClass("active").show(); //Activate first tab $(".tab_mcontent:first").show(); //Show first tab content //On Click Event $(".main_tab li").click(function() { $(".main_tab li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_mcontent").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active content return false; }); /* tab end */ // file var fileTarget = $('.filebox_s .upload-hidden'); fileTarget.on('change', function(){ if(window.FileReader){ var filename = $(this)[0].files[0].name; } else { var filename = $(this).val().split('/').pop().split('\\').pop(); } // $(this).siblings('#nfile1_Text').val(filename); $(document).on("change", "#sfile1", function () { $('#sfile1_Text').val($('#sfile1').val()); }); $(document).on("change", "#sfile2", function () { $('#sfile2_Text').val($('#sfile2').val()); }); }); var fileTarget = $('.filebox_k .upload-hidden'); fileTarget.on('change', function(){ if(window.FileReader){ var filename = $(this)[0].files[0].name; } else { var filename = $(this).val().split('/').pop().split('\\').pop(); } // $(this).siblings('#nfile1_Text').val(filename); $(document).on("change", "#kfile1", function () { $('#kfile1_Text').val($('#kfile1').val()); }); $(document).on("change", "#kfile2", function () { $('#kfile2_Text').val($('#kfile2').val()); }); }); /* Toggle */ $('.submenuM').on('click', function(){ $(this).siblings('.submenu_toggle').stop().slideToggle(); }) // 참고 $(".familysite").click(function(){ $(".familysite_box").stop().slideToggle(300); if ($(this).css('backgroundImage').indexOf('up') != -1) { $('.bg').length > 0 ? $(this).css('backgroundImage', 'url(/img_new/down.png)') : $(this).css('backgroundImage', 'url(/img_new/down.png)') } else { $('.bg').length > 0 ? $(this).css('backgroundImage', 'url(/img_new/up.png)') : $(this).css('backgroundImage', 'url(/img_new/up.png)') } }); $("#h_write").click(function(){ $("#re_write").stop().slideToggle('slow'); }); //$('.btn-menu').on('click', function(){ // $(this).siblings('.menubox').stop().slideToggle(); // }) /* Toggle end */ });