$(function(){ var scrollAction=true; /*scroll*/ var scrollTop = ''; navTop = $('.navWrap').offset().top; if($('body').data('style') == 'Form'){ $(".addFormImg").on("click",function (event){ event.stopPropagation(); console.log("set"); var thisLi = $(this).closest('li'); targetId = $(this).parent('a').attr('href'); if(thisLi.hasClass("open")){ $(targetId).hide(); $(targetId).removeClass("blockView"); $(targetId).addClass("hideView"); thisLi.find('.addFormImg').attr('src', '/images/plus.svg'); thisLi.removeClass('open'); }else{ $(targetId).show(); $(targetId).addClass("blockView"); $(targetId).removeClass("hideView"); thisLi.find('.addFormImg').attr('src', '/images/minus.svg'); thisLi.addClass('open'); } }) $('.section_list').find('a').on('click', function(e) { e.preventDefault(); var thisLi = $(this).parent('li'); targetId = $(this).attr('href'); targetOffset = $(targetId).offset().top; if(thisLi.hasClass('flex')){ $(targetId).show(); $(targetId).addClass("blockView"); $(targetId).removeClass("hideView"); targetOffset = $(targetId).offset().top; thisLi.find('.addFormImg').attr('src', '/images/minus.svg'); thisLi.addClass('open'); // if(thisLi.hasClass('on')){ // console.log("set"); // $(targetId).hide(); // thisLi.find('.addFormImg').attr('src', '/images/plus.svg'); // thisLi.removeClass('open'); // } } $('.section_list li').removeClass('on'); thisLi.addClass('on'); scrollAction=false; $('html, body').animate({ scrollTop: targetOffset+1 }, 500,function (){ console.log("11") $('.section_list li').removeClass('on'); thisLi.addClass('on'); scrollAction=true; }); }); $( ".datepicker" ).datepicker({ dateFormat : 'yy-mm-dd', showOtherMonths: true, showMonthAfterYear: true, changeYear: true, changeMonth: true, monthNames : ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월',' 9월', '10월', '11월', '12월'], monthNamesShort : ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월',' 9월', '10월', '11월', '12월'], monthNamesMin : ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월',' 9월', '10월', '11월', '12월'], dayNames : ['일','월', '화', '수', '목', '금', '토'], dayNamesShort : ['일','월', '화', '수', '목', '금', '토'], dayNamesMin : ['일','월', '화', '수', '목', '금', '토'] }); } if($('body').data('page') == 'View'){ var thisLi = ''; targetId = ''; targetOffset = ''; $('.sideIdx_list').find('a').on('click', function(e){ e.preventDefault(); thisLi = $(this).parent('li'); targetId = $(this).attr('href'); targetOffset = $(targetId).offset().top; $('.sideIdx_list').find('li').removeClass('on'); thisLi.addClass('on'); $('html, body').animate({ scrollTop: targetOffset }, 500); }) } if($('body').data('page') == 'Center'){ $('.accodi_list li').on('click', function(){ $('.accodi_list li').removeClass('on'); $('.accodi_list li').find('.A').hide(); $(this).addClass('on'); $(this).find('.A').slideDown(); }) } $(window).scroll(function(){ scrollTop = $(this).scrollTop(); //네비 if(navTop <= scrollTop){ $('.navWrap').addClass('fixed') $('.navTempBody').show(); }else{ $('.navWrap').removeClass('fixed') $('.navTempBody').hide(); } //Form side floating if($('body').data('style') == 'Form'){ var secTop = ''; thisSecTop =''; $('.formSection').each(function(index){ secTop = parseInt($(this).offset().top); if($('body').data('page') == 'ResumeForm'){ console.log(secTop); console.log(scrollTop); if(secTop < scrollTop){ if($('.formSection').eq(index).css('display') == 'block'){ if(scrollAction) { $('.section_list li').removeClass('on'); $('.section_list li').eq(index).addClass('on'); } } } } if($('body').data('page') == 'ResumeView'){ if(secTop-100 < scrollTop){ $('.section_list li').removeClass('fin'); $('.section_list li').eq(index).addClass('fin'); } } }) } //View side floating if($('body').data('page') == 'View'){ var secTop = ''; $('.sideIdxTop').each(function(index){ secTop = parseInt($(this).offset().top); console.log(secTop); console.log(scrollTop); if(secTop - 300 < scrollTop){ $('.sideIdx_list li').removeClass('on'); $('.sideIdx_list li').eq(index).addClass('on'); } }) } }) /*영역 외 클릭*/ $(document).on('mouseup', function(e) { if ($('.selectDiv').has(e.target).length == 0) { $('.option_list').hide(); $('.selectDiv').removeClass('on'); } }); $(document).on('mouseup', function(e) { if ($('.optMenuDiv').has(e.target).length == 0) { $('.optMenu_list').hide(); } }); $(document).on('mouseup', function(e) { if ($('.applyView .titList_wrap').has(e.target).length == 0) { $('.applyView .titList_wrap').hide(); } }); $('.selectDiv').off().on('click', function(e){ if(!$(this).hasClass('on')){ $(this).addClass('on'); $(this).find('.option_list').slideDown(200) }else{ $(this).find('.option_list').hide() $(this).removeClass('on'); } }); $('.allMenuDiv').on('click', function(){ if(!$(this).hasClass('on')){ $(this).addClass('on'); $(this).find('.option_list').slideDown(200) }else{ $(this).removeClass('on'); $(this).find('.option_list').slideUp(200) } }) var thisDiv = ''; thisTxt = ''; $('.option_list li').on('click', function(e){ e.stopPropagation(); thisDiv = $(this).parents('.selectDiv'); thisTxt = $(this).text(); if(!$(this).find('a')){ thisDiv.find('.selectTxt').text(thisTxt); } thisDiv.removeClass('on'); thisDiv.find('.option_list').slideUp(200) }) /*MAIN*/ var sideIdx = ''; $('.sideTab_list li').on('click', function(){ sideIdx = $(this).index()+1; if($(this).hasClass("nolink")){ $('.sideTab_list li').removeClass('on'); $(this).addClass('on'); $('.recruitDiv').hide(); $('.page0'+sideIdx+'').show(); } if(sideIdx !=3 && sideIdx !=4 && sideIdx !=5 && sideIdx !=6){ } if(sideIdx == 1){ $('.page01').css('display', 'flex') } }) $('.scrap').on('click', function(e){ // e.stopPropagation(); // $(this).toggleClass('on') }); $('.viewCont_wrap').find('.scrap_wrap').on('click', function(){ event.stopPropagation(); $(this).find('.scrap').trigger('click') }) $('.subInfo').on('click', function(){ $(this).addClass('on'); $(this).next('.subInfoPop').show() }) var btnClass=""; var popClass=""; $('.layerPopBtn').on('click', function(){ btnClass = $(this).attr('class'); popClass = btnClass.split(/\s+/); if(popClass[1]!="simple"){ $('.layerPopup').hide(); $('.layerPopup.'+popClass[1]).show(); } }) $('.popX, .pop_wrap .button_wrap .cancel').on('click', function(){ $(this).parents('.layerPopup').hide(); $('.subInfo').removeClass('on'); }); if($('body').data('page') == 'ResumeForm'){ $('.profileWrap.fold').find('.edit').on('click', function(){ $('.profileWrap.fold').hide(); $('.profileWrap.unfold').show(); }) var btnClass=""; var popClass=""; $('.showFormBtn').on('click', function(){ btnClass = $(this).attr('class'); popClass = btnClass.split(/\s+/); $(this).parent('.subTit_wrap').hide(); $('.tdDiv.'+popClass[1]).show(); }) // $('.depthDiv02 .depth_list li').on('click', function(){ // $(this).toggleClass('on') // }) // // $('.del').on('click', function(){ // $(this).parent('li').remove() // }) } $('.etcLi').find('.radioInput').on('change', function(){ if($(this).is(':checked')){ $(this).parents('.etcLi').addClass('on'); }else{ $(this).parents('.etcLi').removeClass('on'); } }) $('.stepTab').on('click', function(){ $('.stepTab').removeClass('on'); $(this).addClass('on'); if($(this).hasClass('step1')){ $('.section_list').show(); $('.pointImg_wrap').hide(); }else{ $('.pointImg_wrap').show(); $('.section_list').hide(); } }) // $('.pointImg_list li').not('.imgMore').on('click', function(){ // $('.pointImg_list li').removeClass('on'); // $(this).addClass('on') // }) var tabIdx = ''; $('.imgTab_list li').on('click', function(){ tabIdx = $(this).index(); $('.imgTab_list li').removeClass('on'); $(this).addClass('on'); $('.imgSelect_list > li').removeClass('on'); $('.imgSelect_list > li').eq(tabIdx).addClass('on') }) /*search tab*/ var mypgNavDepth2 = ''; $('.mypgNav_list > li').on('click', function(){ mypgNavDepth2 = $('.mypgNav_list').find('.depth2_list'); $('.mypgNav_list > li').removeClass('on'); mypgNavDepth2.find('li').removeClass('on'); $(this).addClass('on'); if($(this).hasClass('depth')){ mypgNavDepth2.hide(); $(this).find('.depth2_list').show(); } }) $('.mypgNav_list').find('.depth2_list li').on('click', function(e){ e.stopPropagation(); $(this).parent('.depth2_list').find('li').removeClass('on'); $(this).addClass('on') }) $('.onoff').on('click', function(){ $(this).toggleClass('on') }) $('.optMenuBtn').on('click', function(){ $(this).next('.optMenu_list').show() }) // 근무형태 툴팁 if(document.querySelector('.icon_tip')) { document.querySelector('.icon_tip').addEventListener('click', function (event) { const modal = document.getElementById('itp_type'); if (modal.style.display === 'none' || modal.style.display === '') { const rect = event.target.getBoundingClientRect(); // modal.style.top = `${rect.bottom + window.scrollY}px`; // modal.style.left = `${rect.left + window.scrollX}px`; modal.style.display = 'block'; } else { modal.style.display = 'none'; } }); } if(document.querySelector('.closeBtn')) { document.getElementById('closeBtn').addEventListener('click', function () { document.getElementById('itp_type').style.display = 'none'; }); } window.addEventListener('click', function(event) { const modal = document.getElementById('itp_type'); // Check if modal exists before accessing its properties if (modal && event.target.closest('.icon_tip') === null && event.target.closest('#itp_type') === null) { modal.style.display = 'none'; } }); $(document).ready(function() { let CntParse = true; let navTop = $('.navWrap').offset().top; function toggleModals(linkId, modalId, otherModalId) { $(linkId).on("click", function() { $(modalId).toggle(); $(otherModalId).hide(); $(".dave").toggleClass("active"); if (CntParse) { $.ajax({ url: '/Main/Ajax/MySuportCnt.php', type: 'POST', dataType: 'json', async: false, success: function(result) { $("#myOfferCnt").html(result.myOfferCnt); $("#myOfferCnt_Over").html(result.myOfferCnt); $("#mySupportCnt").html(result.mySupportCnt); $("#mySupportCnt_Over").html(result.mySupportCnt); CntParse = false; }, error: function(result) { console.error("Error:", result); }, complete: function(result) { console.log("Completed:", result); }, beforeSend: function(result) { console.log("Started:", result); } }); } }); } toggleModals("#myPageLink", "#myPageModal", "#myPageModal2"); toggleModals("#myPageLink2", "#myPageModal2", "#myPageModal"); $("#myModalClolse").on("click", function() { $("#myPageModal, #myPageModal2").hide(); $(".dave").removeClass("active"); }); $(window).scroll(function() { $('.navWrap').toggleClass('fixed', $(this).scrollTop() >= navTop); $("#myPageModal, #myPageModal2").hide(); $(".dave").removeClass("active"); }); }); });