$(function(){ // gnb $("nav > ul > li > a").on("mouseenter", function(){ $("header").addClass("open"); }); $("nav > ul > li").on("mouseenter", function(){ $("nav > ul > li > a").removeClass("on"); $(this).children("a").addClass("on"); }); $("header").on("mouseleave", function(){ $("nav > ul > li > a").removeClass("on"); $("header").removeClass("open"); }); // faq $(".faq li > p").click(function(){ $(this).parents(".faq").find(".a").hide(); $(this).siblings(".a").show(); }); // input=file var fileTarget = $('.filebox .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('.upload-name').val(filename); }); // clause list $(".clause_list li div").hide(); $(".clause_list li:first-child div").show(); $(".clause_list .btn_open").click(function(){ $(this).parent().siblings().find("div").hide(); $(this).siblings("div").show(); }); // select if($(".select").length > 0){ $('.select').jqTransform(); }; // location if($(".sub_depth").length > 0){ $(".location .depth1").css("cursor","pointer"); $(".location .depth1").click(function(){ $(this).siblings("ul").show(); }); $(".sub_depth a").click(function(){ $(".sub_depth").hide(); }); } $(document).mouseup(function(e) { var container = $(".sub_depth"); //var container_in = $(".search .option"); if (!container.is(e.target) && container.has(e.target).length === 0){ container.css("display","none"); //container.find("li").removeClass("open"); } }); // popup close $(".layer_popup .close").click(function(){ $(this).parent().hide(); $(".dim").remove(); }); // tab if($(".tab li > a.on").siblings("ul").length > 0){ $(".tab").css("height","130px"); } // review rolling var swiper = new Swiper('.review_rolling', { autoHeight : 'true', autoplay: { delay: 3500, disableOnInteraction: false, }, pagination: { el: '.swiper-pagination', }, }); }); // layer pop function openLayer(ele){ var _this = $("."+ele + "_popup"); var _thisW = _this.width() / 2; var _thisH = _this.height() / 2; _this.css('margin-left',-_thisW); _this.css('margin-top',-_thisH); _this.show(); $("body").append("
"); } function closeLayer(ele){ var _this = $("."+ele + "_popup"); _this.hide(); $(".dim").remove(); } // layer pop function lockLayer(ele){ var _this = $("#"+ele); _this.show(); $("body").append("
"); } function unlockLayer(ele){ var _this = $("#"+ele); _this.hide(); $(".dim").remove(); }