// 메인 로그인 체크박스 이벤트 $(function(){ $('.visual_login_box .chk-type label').click(function(){ $(this).toggleClass('on'); }); }); // fly Banner // $(function(){ // $(window).resize(function(){ // // var ofleft = $('.fly_wrap').offset().left; // var ofleft = $('.fly_wrap').offset(); // var ofwidth = $('.fly_wrap').width(); // var fly2width = $('.fly_Banner').width(); // $('.fly_Banner').css({'left':ofleft+ofwidth+0,'top':150}) // }) // $(window).trigger('resize') // $(window).scroll(function(){ // var sct = $(this).scrollTop() // $('.fly_Banner').stop().animate({'top':sct+150},100) // }) // }) //tab nav 메뉴 $(function() { var cont = $('.slide_tabcon'), nav = $('.tab_nav'), head_height = $('.header').outerHeight(), nav_height = nav.outerHeight() + head_height + 20, topwrapper = $('.top_wrapper').outerHeight() - nav_height; $(window).on('scroll', function() { var pos = $(this).scrollTop(); cont.each(function() { var top = Math.floor($(this).offset().top); console.log('pos : '+pos); console.log('offset : '+top); if (pos >= (top - nav_height)) { nav.addClass('nav_fixd'); nav.find('a').removeClass('on'); nav.find('a[href="#' +$(this).attr('id')+ '"]').addClass('on'); cont.removeClass('on'); $(this).addClass('on'); $('.top_nav').show(); } if (pos < topwrapper + 70) { nav.removeClass('nav_fixd'); nav.find('a').removeClass('on'); cont.removeClass('on'); $('.top_nav').hide(); } }); }); nav.find('a').on('click', function(e) { e.preventDefault(); var path = $(this).attr('href'); var offset = Math.floor($(path).offset().top) - nav_height; $('html, body').animate({ scrollTop: offset }, 200); }); $('.top_nav').on('click', function(e){ // 필요없는 경우 삭제 e.preventDefault(); $('body, html').animate({ scrollTop:0 }, 200); }); }); //고객지원 FAQ // tab 메뉴 클릭시 on클레스 작동 $(function(){ $('.faq_list li p').click(function(){ var $this = $(this), $thisWrap = $this.parent(); $thisWrap.siblings().removeClass("on"); $thisWrap.toggleClass('on'); }); }); // tab slide $(function(){ var st = $('.slider1 li.slider'); var stIdx = Math.floor(0); var hisnum = null; var stimg = null; st.eq(stIdx).addClass('on').find('.slide1_con').css('display','block') //자동으로 3초마다 실행 var sliderhend = setInterval(function(){ $('.slider1 .btn_nx').trigger('click') },3000) //번호크기에 따라 이동이변함 st.on({ click:function(){ hisnum=stIdx; stIdx = $(this).index() if(hisnum < stIdx){ stimg = st.eq(hisnum).find('.slide1_con') slideMotion(stimg,0,"-100%",500) stimg = st.eq(stIdx).find('.slide1_con') slideMotion(stimg,"100%",0,500) }else if(hisnum > stIdx){ stimg = st.eq(hisnum).find('.slide1_con') slideMotion(stimg,0,"100%",500) stimg = st.eq(stIdx).find('.slide1_con') slideMotion(stimg,"-100%",0,500) }else if(hisnum == stIdx){ // return false; } // return false; } }) //마우스오버시 정지/실행 $('.slider1').on({ mouseenter:function(){ clearInterval(sliderhend); }, mouseleave:function(){ sliderhend = setInterval(function(){ $('.slider1 .btn_nx').trigger('click'); },3000); } }) //다음클릭 $('.slider1 .btn_nx').click(function(){ stimg = st.eq(stIdx).find('.slide1_con') slideMotion(stimg,0,"-100%",500) stIdx ++ stimg = st.eq(stIdx).find('.slide1_con') slideMotion(stimg,"100%",0,500) }); //이전클릭 $('.slider1 .btn_pr').click(function(){ stimg = st.eq(stIdx).find('.slide1_con') slideMotion(stimg,0,"100%",500) stIdx -- stimg = st.eq(stIdx).find('.slide1_con') slideMotion(stimg,"-100%",0,500) }); //다음이전함수 재사용 function slideMotion(select,start,end,speed){ select.parent('li').addClass('on').siblings("li").removeClass('on') select.css({ left:start, display:'block' }).stop().animate({ left:end },speed) if(stIdx == st.length){ stIdx=0; stimg = st.eq(stIdx).find('.slide1_con'); slideMotion(stimg,"100%",0,500); }else if(0>stIdx){ //console.log(stIdx) stIdx=st.length-1; stimg = st.eq(stIdx).find('.slide1_con'); slideMotion(stimg,"-100%",0,500); } } }) //tab02 $(function(){ var st = $('.slider2 li.slider'); var stIdx = Math.floor(0); var hisnum = null; var stimg = null; st.eq(stIdx).addClass('on').find('.slide2_con').css('display','block') //자동으로 3초마다 실행 var sliderhend = setInterval(function(){ $('.slider2 .btn_nx').trigger('click') },3000) //번호크기에 따라 이동이변함 st.on({ click:function(){ hisnum=stIdx; stIdx = $(this).index() if(hisnum < stIdx){ stimg = st.eq(hisnum).find('.slide2_con') slideMotion(stimg,0,"-100%",500) stimg = st.eq(stIdx).find('.slide2_con') slideMotion(stimg,"100%",0,500) }else if(hisnum > stIdx){ stimg = st.eq(hisnum).find('.slide2_con') slideMotion(stimg,0,"100%",500) stimg = st.eq(stIdx).find('.slide2_con') slideMotion(stimg,"-100%",0,500) }else if(hisnum == stIdx){ // return false; } // return false; } }) //마우스오버시 정지/실행 $('.slider2').on({ mouseenter:function(){ clearInterval(sliderhend); }, mouseleave:function(){ sliderhend = setInterval(function(){ $('.slider2 .btn_nx').trigger('click'); },3000); } }) //다음클릭 $('.slider2 .btn_nx').click(function(){ stimg = st.eq(stIdx).find('.slide2_con') slideMotion(stimg,0,"-100%",500) stIdx ++ stimg = st.eq(stIdx).find('.slide2_con') slideMotion(stimg,"100%",0,500) }); //이전클릭 $('.slider2 .btn_pr').click(function(){ stimg = st.eq(stIdx).find('.slide2_con') slideMotion(stimg,0,"100%",500) stIdx -- stimg = st.eq(stIdx).find('.slide2_con') slideMotion(stimg,"-100%",0,500) }); //다음이전함수 재사용 function slideMotion(select,start,end,speed){ select.parent('li').addClass('on').siblings("li").removeClass('on') select.css({ left:start, display:'block' }).stop().animate({ left:end },speed) if(stIdx == st.length){ stIdx=0; stimg = st.eq(stIdx).find('.slide2_con'); slideMotion(stimg,"100%",0,500); }else if(0>stIdx){ //console.log(stIdx) stIdx=st.length-1; stimg = st.eq(stIdx).find('.slide2_con'); slideMotion(stimg,"-100%",0,500); } } }) //tab02 $(function(){ var st = $('.slider3 li.slider'); var stIdx = Math.floor(0); var hisnum = null; var stimg = null; st.eq(stIdx).addClass('on').find('.slide3_con').css('display','block') //자동으로 3초마다 실행 var sliderhend = setInterval(function(){ $('.slider3 .btn_nx').trigger('click') },3000) //번호크기에 따라 이동이변함 st.on({ click:function(){ hisnum=stIdx; stIdx = $(this).index() if(hisnum < stIdx){ stimg = st.eq(hisnum).find('.slide3_con') slideMotion(stimg,0,"-100%",500) stimg = st.eq(stIdx).find('.slide3_con') slideMotion(stimg,"100%",0,500) }else if(hisnum > stIdx){ stimg = st.eq(hisnum).find('.slide3_con') slideMotion(stimg,0,"100%",500) stimg = st.eq(stIdx).find('.slide3_con') slideMotion(stimg,"-100%",0,500) }else if(hisnum == stIdx){ // return false; } // return false; } }) //마우스오버시 정지/실행 $('.slider3').on({ mouseenter:function(){ clearInterval(sliderhend); }, mouseleave:function(){ sliderhend = setInterval(function(){ $('.slider3 .btn_nx').trigger('click'); },3000); } }) //다음클릭 $('.slider3 .btn_nx').click(function(){ stimg = st.eq(stIdx).find('.slide3_con') slideMotion(stimg,0,"-100%",500) stIdx ++ stimg = st.eq(stIdx).find('.slide3_con') slideMotion(stimg,"100%",0,500) }); //이전클릭 $('.slider3 .btn_pr').click(function(){ stimg = st.eq(stIdx).find('.slide3_con') slideMotion(stimg,0,"100%",500) stIdx -- stimg = st.eq(stIdx).find('.slide3_con') slideMotion(stimg,"-100%",0,500) }); //다음이전함수 재사용 function slideMotion(select,start,end,speed){ select.parent('li').addClass('on').siblings("li").removeClass('on') select.css({ left:start, display:'block' }).stop().animate({ left:end },speed) if(stIdx == st.length){ stIdx=0; stimg = st.eq(stIdx).find('.slide3_con'); slideMotion(stimg,"100%",0,500); }else if(0>stIdx){ //console.log(stIdx) stIdx=st.length-1; stimg = st.eq(stIdx).find('.slide3_con'); slideMotion(stimg,"-100%",0,500); } } }) //tab03 $(function(){ var st = $('.slider4 li.slider'); var stIdx = Math.floor(0); var hisnum = null; var stimg = null; st.eq(stIdx).addClass('on').find('.slide4_con').css('display','block') //자동으로 3초마다 실행 var sliderhend = setInterval(function(){ $('.slider4 .btn_nx').trigger('click') },3000) //번호크기에 따라 이동이변함 st.on({ click:function(){ hisnum=stIdx; stIdx = $(this).index() if(hisnum < stIdx){ stimg = st.eq(hisnum).find('.slide4_con') slideMotion(stimg,0,"-100%",500) stimg = st.eq(stIdx).find('.slide4_con') slideMotion(stimg,"100%",0,500) }else if(hisnum > stIdx){ stimg = st.eq(hisnum).find('.slide4_con') slideMotion(stimg,0,"100%",500) stimg = st.eq(stIdx).find('.slide4_con') slideMotion(stimg,"-100%",0,500) }else if(hisnum == stIdx){ // return false; } // return false; } }) //마우스오버시 정지/실행 $('.slider4').on({ mouseenter:function(){ clearInterval(sliderhend); }, mouseleave:function(){ sliderhend = setInterval(function(){ $('.slider4 .btn_nx').trigger('click'); },3000); } }) //다음클릭 $('.slider4 .btn_nx').click(function(){ stimg = st.eq(stIdx).find('.slide4_con') slideMotion(stimg,0,"-100%",500) stIdx ++ stimg = st.eq(stIdx).find('.slide4_con') slideMotion(stimg,"100%",0,500) }); //이전클릭 $('.slider4 .btn_pr').click(function(){ stimg = st.eq(stIdx).find('.slide4_con') slideMotion(stimg,0,"100%",500) stIdx -- stimg = st.eq(stIdx).find('.slide4_con') slideMotion(stimg,"-100%",0,500) }); //다음이전함수 재사용 function slideMotion(select,start,end,speed){ select.parent('li').addClass('on').siblings("li").removeClass('on') select.css({ left:start, display:'block' }).stop().animate({ left:end },speed) if(stIdx == st.length){ stIdx=0; stimg = st.eq(stIdx).find('.slide4_con'); slideMotion(stimg,"100%",0,500); }else if(0>stIdx){ //console.log(stIdx) stIdx=st.length-1; stimg = st.eq(stIdx).find('.slide4_con'); slideMotion(stimg,"-100%",0,500); } } }) //tab04 // 팝업스크립트 $(function(){ popcenter(400,500,0,$(".layer_notice")); //이용약관 변경안내 팝업 $('.next_notice_btn').click(function(){ popcenter(400,500,1,$(".layer_next_notice")); }) $(".layer_next_notice").hide(); $(".next_notice_btn").click(function(){ $(".next_notice_btn").blur(); $(".layer_next_notice").show(); $(".layer_next_notice").focus(); $(".layer_notice").hide(); $(".layer_next_notice .pop_header .tit").append( '변경 약관 보기' ); // return false; }); $(".layer_next_notice").keydown(function(e){ if(e.shiftKey && e.keyCode == 9){ // Shift + Tab 키를 의미합니다. $(".next_notice_btn").focus(); $(".layer_next_notice").hide(); $(".layer_notice").hide(); // return false; } }); //변경 이용약관 팝업 $('.terms_btn').click(function(){ popcenter(400,500,1,$(".layer_next_notice")); }) $(".layer_next_notice").hide(); $(".terms_btn").click(function(){ $(".terms_btn").blur(); $(".layer_next_notice").show(); $(".layer_next_notice").focus(); $(".layer_notice").hide(); $(".layer_next_notice .pop_header .tit").empty(); // 공지팝업 변경약관보기 버튼클릭시 들어간 타이틀 삭제 $(".layer_next_notice .pop_header .tit").append( '이용약관' ); // return false; }); $(".layer_next_notice").keydown(function(e){ if(e.shiftKey && e.keyCode == 9){ // Shift + Tab 키를 의미합니다. $(".terms_btn").focus(); $(".layer_next_notice").hide(); $(".layer_notice").hide(); // return false; } }); //이전 이용약관 팝업 $('.prev_notice_btn').click(function(){ popcenter(400,500,1,$(".layer_terms")); }) $(".layer_terms").hide(); $(".prev_notice_btn").click(function(){ $(".prev_notice_btn").blur(); $(".layer_terms").show(); $(".layer_terms").focus(); $(".layer_notice").hide(); // return false; }); $(".layer_terms").keydown(function(e){ if(e.shiftKey && e.keyCode == 9){ // Shift + Tab 키를 의미합니다. $(".prev_notice_btn").focus(); $(".layer_terms").hide(); $(".layer_notice").hide(); // return false; } }); //아이디 찾기 find_box login_layer $("#find_id_btn").click(function() { popcenter(400,500); }) $("#find_id").hide(); $("#find_id_btn").click(function(){ $("#find_id_btn").blur(); $("#find_id").show(); $("#find_id").focus(); // return false; }); $("#find_id").keydown(function(e){ if(e.shiftKey && e.keyCode == 9){ // Shift + Tab 키를 의미합니다. $("#find_id_btn").focus(); $("#find_id").hide(); // return false; } }); //아이디 찾기 find_box login_layer $("#find_pw_btn").click(function() { popcenter(400,500); }) $("#find_pw").hide(); $("#find_pw_btn").click(function(){ $("#find_pw_btn").blur(); $("#find_pw").show(); $("#find_pw").focus(); // return false; }); $("#find_pw").keydown(function(e){ if(e.shiftKey && e.keyCode == 9){ // Shift + Tab 키를 의미합니다. $("#find_pw_btn").focus(); $("#find_pw").hide(); // return false; } }); }); //로그인 팝업 // $('.visual_login_box>a').click(function(){ // popcenter(400,500); // }) // $(".alert_layer").hide(); // $(".visual_login_box>a").click(function(){ // $(".visual_login_box>a").blur(); // $(".alert_layer").show(); // $(".alert_layer").focus(); // // return false; // }); // $(".alert_layer").keydown(function(e){ // if(e.shiftKey && e.keyCode == 9){ // Shift + Tab 키를 의미합니다. // $(".visual_login_box>a").focus(); // $(".alert_layer").hide(); // // return false; // } // }); //팝업이 생성되는 함수 (width,height,top) function popcenter(w,h,flag,target){ blind(flag,target); //layer 공통 닫기버튼의 기능 // $('.btn-close').click(function(){ // $('.p_layer').hide() // }) //layer 공지사항 닫기버튼의 기능 $('.notice .btn-close').click(function(){ $('.p_layer.notice').hide() }) //layer 이전 이용약관 닫기버튼의 기능 $('.layer_terms .btn-close').click(function(){ $('.p_layer.layer_terms').hide() }) //layer 변경 이용약관 닫기버튼의 기능 $('.layer_next_notice .btn-close').click(function(){ $('.p_layer.layer_next_notice').hide() }) //로그인 박스 닫기버튼의 기능 $('.alert_close').click(function(){ $('.alert_layer').hide() }) //layer 공통 닫기버튼의 기능 $('.btn-close').click(function(){ $('.p_layer').hide() }) $('#layer_btn_close').click(function() { $('.login_layer').hide(); }) $('#alert_btn_close').click(function() { $('.login_layer').hide(); }) } //검은배경이 생기는 함수 function blind(flag, target){ if(flag==1){ $('.pop_blind', target).css({'position':'fixed', 'top':'0', 'left':'0', 'width':'100%', 'height':'100%', 'background':'#000', 'display':'none' ,'z-index':'7777' }).fadeTo(500,.7); } } $(function() { $("#user_pw").keydown(function(e) { if(e.keyCode == 13) { supportNewLogin(); } }); $("#input_userid").keydown(function(e) { if(e.keyCode == 13) { findPwdCheckUserType(); } }); }) function hideAlertLayer() { $("#alert_layer").hide(); } function hideAlertLayer2() { $("#alert_layer2").hide(); }