/*******************************/ /* 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"); }); $(".m-gnb nav > ul > li > a").on("mouseover focusin",function(){ if($(this).parent("li").hasClass("on")){ $(this).removeClass("on"); }else{ $(".m-gnb nav > ul > li.on").each(function() { $(this).removeClass("on"); }); } $(this).parent("li").addClass("on"); //$(".two-depth-bg").show(); }); $(".two-depth").mouseleave(function(){ $(".m-gnb nav > ul > li").removeClass("on"); //$(".two-depth-bg").hide(); }); $(".m-gnb nav > ul > li.off > a").on("mouseleave focusin",function(){ $(".m-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() == $(".visual-tit").text() ){ $(this).children("a").css("color","#1a1a1a"); $(this).children("a").css("border-bottom","1px solid #1a1a1a"); } }); $(".m-gnb nav ul > li").each(function(){ if ($(this).children("a").text() == $(".visual-tit").text() ){ $(this).children("a").css("color","#fff"); $(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 -60 }, 500); 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 */ /** 스크롤이 설정한 높이 이상 내려갔을때 스타일추가하기*/ if (jQuery(window).width() > 0) { jQuery(window).on("scroll",function(ev){ if(jQuery(window).scrollTop() > 100 ) { /**높이 픽셀 조정**/ $("#header").show(); $("#header").show(); $("#m-header").hide(); $("#m-header").hide(); } else{ $("#m-header").show(); $("#m-header").show(); $("#header").hide(); $("#header").hide(); } return false; }); } /* 스크롤이 설정한 높이 이상 내려갔을때 스타일추가하기 end */ /* slide bigmain ver */ $('.slider').slick({ //fade: true, autoplay: true, autoplaySpeed: 6000, speed: 800, lazyLoad: 'progressive', arrows: true, dots: true, pauseOnHover:false, // 마우스 오버시 슬라이드 이동 멈춤 }).slickAnimation(); /* *********************** 서브페이지 ON ************************ */ setTimeout(function () { $("#visual").addClass("active"); }); /* Toggle */ $('.submenuM').on('click', function(){ $(this).siblings('.submenu_toggle').stop().slideToggle(); }) // 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()); }); }); /* tab */ //Default Action $(".tab_contentA").hide(); //Hide all content $("#business li:first").addClass("active").show(); //Activate first tab $(".tab_contentA:first").show(); //Show first tab content //On Click Event $("#business li").click(function() { $("#business li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_contentA").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; }); //Default Action $(".tab_contentB").hide(); //Hide all content $("#product01 li:first").addClass("active").show(); //Activate first tab $(".tab_contentB:first").show(); //Show first tab content //On Click Event $("#product01 li").click(function() { $("#product01 li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_contentB").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 */ // slider var swiper = new Swiper('#roll_partner', { //pagination: { // el: '.swiper_s2 .swiper-pagination', // clickable: true, // }, // navigation: { // nextEl: '.swiper_s2 .swiper-button-next', // prevEl: '.swiper_s2 .swiper-button-prev', // }, slidesPerView: 2, //화면에 보여질 슬라이드 갯수 spaceBetween: 10, loop: true, autoplay: { delay: 4000, speed: 500, disableOnInteraction: false, }, breakpoints: { 768: { slidesPerView: 3, spaceBetween: 20, }, 1024: { slidesPerView: 4, spaceBetween: 20, }, 1200: { slidesPerView: 6, spaceBetween: 20, }, } }); // 1개롤링 }); // main product slider $(document).ready(function() { var owl = $('#proll'); owl.owlCarousel({ loop: true, margin:20, items:4, slideSpeed : 700, autoplay: true, autoplayTimeout: 5000, autoplayHoverPause: true, dots:false, nav:true, responsiveClass:true, responsive:{ 0:{ items:2, margin:20, nav:false }, 768:{ items:2, margin:20, nav:false }, 1024:{ items:3, margin: 20, nav:false, }, 1200:{ items:4, margin: 30, nav:true, } } }); //$('.custompause01').on('click', function() { // owl.trigger('stop.owl.autoplay') // }) // Go to the next item $('.customNextBtn').click(function() { owl.trigger('next.owl.carousel'); //owl.trigger('play.owl.autoplay', [1000]) }) // Go to the previous item $('.customPrevBtn').click(function() { owl.trigger('prev.owl.carousel', [300]); //owl.trigger('play.owl.autoplay', [1000]) }) }) // product