PageSourceSearch

https://jobaram.com/public/js/sub.js

js jobaram.com collected 2026-10-05 06:55:57 UTC 21,234 bytes, 737 lines download raw bytes

1gsap.registerPlugin(ScrollTrigger, ScrollToPlugin)
2
3const blindOn = () => {
4  $(".blind.type2").addClass("active")
5}
6const blindOff = () => {
7  $(".blind.type2").removeClass("active")
8}
9
10const subVisual = () => {
11  const btn = $(".sub-visual-depth-list button, .sub-visual-depth .share button")
12
13  btn.click(function () {
14    $(this).parent().toggleClass("active")
15  })
16}
17
18const recruitSearch = () => {
19  const regionBtn = $(".recruitSearch-wrap .region button");
20  const regionBox = $(".recruitSearch-wrap .region-box");
21  const mapBtn = regionBox.find("input[type=checkbox]");
22  const mapG = $(".region-box-map svg g");
23
24
25  regionBtn.click(function () {
26    $(this).parent().toggleClass("active")
27    $(".blind").toggleClass("active")
28  })
29
30  $(".blind").click(function () {
31    $(this).removeClass("active")
32    regionBtn.parent().removeClass("active")
33  })
34
35  const region1 = () => {
36    const isChecked1 = $('.region-box #cb1-1').is(':checked')
37    const isChecked2 = $('.region-box #cb1-2').is(':checked')
38    const isChecked3 = $('.region-box #cb1-3').is(':checked')
39    const isChecked4 = $('.region-box #cb1-4').is(':checked')
40
41    $('.region-box-map svg g').removeClass('active')
42
43    if (isChecked1) {
44      $('.region-box-map svg g').addClass('active')
45    } else {
46      if (isChecked2) $('.region-box .cb1-2').addClass('active')
47      if (isChecked3) $('.region-box .cb1-3').addClass('active')
48      if (isChecked4) $('.region-box .cb1-4').addClass('active')
49    }
50  }
51
52  const region2 = () => {
53    const isChecked1 = $('.region-box #cb1-1').is(':checked')
54    const isChecked2 = $('.region-box #cb1-2').is(':checked')
55    const isChecked3 = $('.region-box #cb1-3').is(':checked')
56    const isChecked4 = $('.region-box #cb1-4').is(':checked')
57
58    if (!isChecked1 && !isChecked2 && !isChecked3 && !isChecked4) {
59      $('#cb1-1').prop('checked', true)
60    }
61
62    if (isChecked2 && isChecked3 && isChecked4) {
63      $('.region-box #cb1-1').prop('checked', true)
64      $('.region-box #cb1-2').prop('checked', false)
65      $('.region-box #cb1-3').prop('checked', false)
66      $('.region-box #cb1-4').prop('checked', false)
67    }
68
69    region1()
70  }
71
72  const updateButtonText = () => {
73    const checkedText = [];
74    $('.region-box input[type="checkbox"]:checked + label').each(function () {
75      checkedText.push($(this).text());
76    });
77
78    // Update the button text
79    if (checkedText.length > 0) {
80      $('.recruitSearch-wrap .region button').text(checkedText.join('/'));
81    } else {
82      $('.recruitSearch-wrap .region button').text('세종시 전체');
83    }
84  }
85
86  $('.region-box input[type="checkbox"]').on('change', function () {
87    const checkboxId = $(this).attr('id');
88
89    if (checkboxId === 'cb1-1' && $(this).is(':checked')) {
90      $('.region-box #cb1-2').prop('checked', false);
91      $('.region-box #cb1-3').prop('checked', false);
92      $('.region-box #cb1-4').prop('checked', false);
93    } else if (checkboxId !== 'cb1-1' && $('#cb1-1').is(':checked')) {
94      $('.region-box #cb1-1').prop('checked', false);
95      $(this).prop('checked', true);
96    }
97
98    region2();
99    updateButtonText();
100  });
101
102  mapG.click(function () {
103    if (mapG.filter('.active').length === mapG.length) {
104      // If all mapG elements are active, deactivate all and activate only the clicked one
105      mapG.removeClass('active');
106      $(this).addClass('active');
107      const index = mapG.index(this);
108      mapBtn.prop('checked', false);
109      mapBtn.eq(index + 1).prop('checked', true).trigger('change'); // Adjust index for corresponding checkbox
110    } else {
111      // Toggle the clicked mapG element
112      $(this).toggleClass('active');
113      const index = mapG.index(this);
114      mapBtn.eq(index + 1).prop('checked', !mapBtn.eq(index + 1).is(':checked')).trigger('change'); // Adjust index for corresponding checkbox
115    }
116  });
117
118  region2();
119  updateButtonText();
120
121}
122
123const date = () => {
124  $('.datePicker').datepicker({
125    dateFormat: "yy-mm-dd",
126    dayNamesMin: ["일", "월", "화", "수",
127      "목", "금", "토"
128    ],
129    monthNames: ["1월", "2월", "3월", "4월", "5월", "6월",
130      "7월", "8월", "9월", "10월", "11월", "12월"
131    ],
132    monthNamesShort: ["1월", "2월", "3월", "4월", "5월", "6월",
133      "7월", "8월", "9월", "10월", "11월", "12월"
134    ],
135    yearSuffix: "년",
136    prevText: "",
137    nextText: "",
138    showMonthAfterYear: true,
139    changeMonth: true,
140    changeYear: true,
141    yearRange: 'c-60:c+30',
142  })
143}
144
145const apply = () => {
146  const btn = $(".apply-btn a")
147  const form = $(".apply-form")
148
149  btn.click(function (e) {
150    e.preventDefault()
151    btn.removeClass("active")
152    $(this).addClass("active")
153
154    const href = $(this).attr("href")
155    form.removeClass("active")
156    form.filter(href).addClass("active")
157  })
158
159  const fixedMenuWrap = $(".apply-fixedMenu")
160  $(window).scroll(function () {
161    var scrT = $(window).scrollTop() + ($("#footer").height() / 1.5)
162
163    if (scrT > $(document).height() - $(window).height()) {
164      fixedMenuWrap.addClass("bottom")
165    } else {
166      fixedMenuWrap.removeClass("bottom")
167    }
168
169    var scrollTop = $(window).scrollTop()
170
171    if (scrollTop == 0) {
172      fixedMenuWrap.addClass("top")
173    } else {
174      fixedMenuWrap.removeClass("top")
175    }
176  })
177}
178
179const componentTab = () => {
180  const scrollToActiveTab = (listContainer) => {
181    const activeItem = listContainer.find('a.active').parent()[0]
182    if (!activeItem) return
183
184    const container = listContainer[0]
185    const targetLeft = activeItem.offsetLeft - (container.clientWidth / 2) + (activeItem.offsetWidth / 2)
186
187    container.scrollLeft = Math.max(0, targetLeft)
188  }
189
190  $('.tab').each(function () {
191    const $this = $(this)
192    const listContainer = $this.find('ul')
193    const responsiveWidth = $this.data('mxds-responsive')
194    const responsiveActiveMenu = listContainer.find('.active')
195
196    $this.find('>a').on('click', function (e) {
197      e.preventDefault()
198      $this.toggleClass('active')
199    })
200
201    const responsiveTab = () => {
202      const scrWidth = listContainer[0].scrollWidth
203      const isOverflow = scrWidth - 1 > $this.width()
204      const isMobileWidth = responsiveWidth && $(window).width() < responsiveWidth
205
206      if (isOverflow && responsiveActiveMenu.length > 0) {
207        $this.addClass('mxds-tab-responsive-scroll')
208      } else {
209        $this.removeClass('mxds-tab-responsive-scroll')
210        listContainer.scrollLeft(0)
211      }
212
213      if (isMobileWidth) {
214        const appendToggleButtonElement = $this.find('>a')
215
216        $this.removeClass('mxds-tab-responsive-scroll')
217        $this.addClass('mobile')
218
219        if (appendToggleButtonElement.length === 0 && responsiveActiveMenu.length > 0) {
220          $this.prepend(responsiveActiveMenu.clone())
221
222          $this.find('>a').on('click', function (e) {
223            e.preventDefault()
224            $this.toggleClass('active')
225          })
226        }
227      } else {
228        $this.removeClass('mobile active')
229        $this.find('>a').remove()
230      }
231    }
232
233    responsiveTab()
234    $(window).on('resize.componentTab', responsiveTab)
235  })
236
237  $('.sub-tab').each(function () {
238    const $this = $(this)
239    const listContainer = $this.find('> ul')
240    const responsiveWidth = $this.data('mxds-responsive') || 1024
241
242    $this.removeClass('mobile active')
243    $this.find('> a').remove()
244
245    const responsiveSubTab = () => {
246      const isMobileWidth = $(window).width() < responsiveWidth
247      const scrWidth = listContainer[0].scrollWidth
248      const isOverflow = scrWidth - 1 > $this.width()
249
250      $this.removeClass('mobile active')
251      $this.find('> a').remove()
252
253      if (isMobileWidth || isOverflow) {
254        $this.addClass('mxds-tab-responsive-scroll')
255        requestAnimationFrame(() => {
256          scrollToActiveTab(listContainer)
257        })
258      } else {
259        $this.removeClass('mxds-tab-responsive-scroll')
260        listContainer.scrollLeft(0)
261      }
262    }
263
264    responsiveSubTab()
265
266    listContainer.find('a').on('click', function () {
267      requestAnimationFrame(() => {
268        scrollToActiveTab(listContainer)
269      })
270    })
271
272    $(window).on('resize.componentSubTab load.componentSubTab', responsiveSubTab)
273  })
274}
275
276const modal = () => {
277  const openBtn = $(".modal-open")
278  const modal = $(".modal")
279  const closeBtn = modal.find(".modal-close")
280
281  openBtn.click(function (e) {
282    e.preventDefault()
283
284    const href = $(this).attr("href")
285    modal.filter(href).addClass("active")
286    $(".blind").addClass("active")
287  })
288
289  closeBtn.click(function () {
290    modal.removeClass("active")
291  })
292
293  $(".blind").click(function () {
294    $(this).removeClass("active")
295    modal.removeClass("active")
296  })
297}
298
299const resume = () => {
300  const DEFAULT_HEIGHT_REM = 9; // Default height in rem
301  const ALT_HEIGHT_REM = 11.9; // 536px부터는 11.9rem으로 변경
302  const LINE_HEIGHT_PX = parseFloat($('.resume-title').css('line-height')); // Get the line-height in pixels
303
304  const $textarea = $('.resume-title');
305
306  // const resize = () => {
307  //   // Set initial height in rem
308  //   $textarea.css('height', `${DEFAULT_HEIGHT_REM}rem`);
309
310  //   // Adjust height on input
311  //   $textarea.on('input', function () {
312  //     const $this = $(this);
313
314  //     // Reset height to calculate the correct scrollHeight
315  //     $this.css('height', 'auto');
316
317  //     // Calculate the number of lines of text
318  //     const newHeightPx = $this[0].scrollHeight;
319  //     const numberOfLines = newHeightPx / LINE_HEIGHT_PX;
320  //     const minLines = 3; // Minimum lines equivalent to 9rem
321  //     const newHeightRem = numberOfLines > minLines ? (numberOfLines * LINE_HEIGHT_PX) / 10 : DEFAULT_HEIGHT_REM;
322
323  //     // Set the new height only if it exceeds the default height
324  //     $this.css('height', `${newHeightRem - 3}rem`);
325  //   });
326
327  //   // Ensure height remains 9rem on click (if needed)
328  //   $textarea.on('click', function () {
329  //     const currentHeightPx = $textarea[0].scrollHeight;
330  //     const currentHeightRem = currentHeightPx / 10; // Convert px to rem assuming 1rem = 10px
331
332  //     if (currentHeightRem <= DEFAULT_HEIGHT_REM) {
333  //       $textarea.css('height', `${DEFAULT_HEIGHT_REM}rem`);
334  //     }
335  //   });
336  // }
337  const resize = () => {
338    // setHeight 추가
339    const setHeight = () => {
340      const viewportWidth = $(window).width();
341      const minRem = viewportWidth <= 536 ? ALT_HEIGHT_REM : DEFAULT_HEIGHT_REM;
342      $textarea.css('height', `${minRem}rem`);
343    };
344
345    const resizeTextarea = () => {
346      const viewportWidth = $(window).width();
347      const minRem = viewportWidth <= 536 ? ALT_HEIGHT_REM : DEFAULT_HEIGHT_REM;
348
349      // Reset height to calculate the correct scrollHeight
350      $textarea.css('height', 'auto');
351
352      // Calculate the number of lines of text
353      const newHeightPx = $textarea[0].scrollHeight;
354      const numberOfLines = newHeightPx / LINE_HEIGHT_PX;
355      const newHeightRem = numberOfLines > minRem / (LINE_HEIGHT_PX / 10) ? (numberOfLines * LINE_HEIGHT_PX) / 10 : minRem;
356
357      // Set the new height only if it exceeds the default height
358      $textarea.css('height', `${Math.max(newHeightRem, minRem)}rem`);
359    };
360
361    // 텍스트 입력 후 다 지울 시 height 초기 값으로 변경
362    const initialize = () => {
363      setHeight();
364
365      $(window).on('resize', function () {
366        setHeight();
367      });
368
369      // Adjust height on input
370      $textarea.on('input', function () {
371        if ($(this).val() === '') {
372          setHeight();
373        } else {
374          resizeTextarea();
375        }
376      });
377
378      // Ensure height remains appropriate on click (if needed)
379      $textarea.on('click', function () {
380        const currentHeightPx = $textarea[0].scrollHeight;
381        const currentHeightRem = currentHeightPx / 10; // Convert px to rem assuming 1rem = 10px
382        const viewportWidth = $(window).width();
383        const minRem = viewportWidth <= 536 ? ALT_HEIGHT_REM : DEFAULT_HEIGHT_REM;
384
385        if (currentHeightRem <= minRem) {
386          $textarea.css('height', `${minRem}rem`);
387        }
388      });
389    }
390
391    initialize()
392  }
393
394  resize()
395
396
397  $('.board-wrap-recruit > li > div .infomation-desc > b').each(function () {
398    if ($(this).text().trim() === '') {
399      $(this).addClass('hidden')
400    }
401  })
402}
403
404const form = () => {
405  const agreeRadio = $('#agree[name="workingConditions"]')
406  const disagreeRadio = $('#disagree[name="workingConditions"]')
407
408  agreeRadio.click(function () {
409    $(this).closest('table').find('tr.hide').show()
410  })
411
412  disagreeRadio.click(function () {
413    $(this).closest('table').find('tr.hide').hide()
414  })
415}
416
417const hireService = () => {
418  /*20241211 강희태 수정*/
419  /* const swiperLenth,Total 스와이퍼 다음에 선언하면 늘어난 개수로 가져와서 페이징 안맞음*/
420  const swiperLength = $(".hireService-slide .swiper-slide").length
421  const swiperTotal = $(".hireService-controller .total")
422  swiperTotal.text(swiperLength)
423
424  var swiper = new Swiper(".hireService-slide", {
425    slidesPerView: 1,
426    spaceBetween: 20,
427    speed: 1000,
428    loop: true,
429    autoplay: true,
430    delay: 8000,
431    pagination: {
432      el: ".hireService-controller .pagination",
433      type: 'bullets',
434      clickable: true,
435      renderBullet: function (index, className) {
436        return '<span class="' + className + '">' + '0' + (index + 1) + "</span>";
437      },
438    },
439    navigation: {
440      nextEl: ".hireService-controller .next",
441      prevEl: ".hireService-controller .prev",
442    },
443    breakpoints: {
444      1024: {
445        slidesPerView: 2,
446        spaceBetween: 20,
447      },
448    },
449  })
450
451  const totalEl = document.querySelector('.pagination-wrap .total');
452  if (totalEl) {
453    const n = parseInt(totalEl.textContent.trim(), 10) || 0;
454    totalEl.textContent = String(n).padStart(2, '0'); // 3→"03", 10→"10"
455  }
456
457  const play = $(".hireService-controller .play")
458  const pause = $(".hireService-controller .pause")
459
460  pause.click(function () {
461    swiper.autoplay.stop()
462    $(this).hide()
463    play.show()
464  })
465
466  play.click(function () {
467    swiper.autoplay.start()
468    $(this).hide()
469    pause.show()
470  })
471
472
473
474  var swiper2 = new Swiper(".hireService-tab", {
475    slidesPerView: "auto",
476    spaceBetween: 8,
477    breakpoints: {
478      1280: {
479        slidesPerView: 9,
480        spaceBetween: 8,
481      }
482    }
483  })
484
485  const tabA = $(".hireService-tab > ul > li > a")
486  const tabCont = $(".hireService-tab-cont")
487
488  // tabA.click(function(e) {
489  //   e.preventDefault()
490  //   tabA.removeClass("active")
491  //   $(this).addClass("active")
492
493  //   const href = $(this).attr("href")
494  //   tabCont.removeClass("active")
495  //   tabCont.filter(href).addClass("active")
496  // })
497
498  tabA.hover(function () {
499    $(this).addClass("active2")
500    var icon = $(this).find('object')
501    var data = icon.attr('data')
502    icon.attr('data', data)
503  })
504  tabA.mouseleave(function () {
505    $(this).removeClass("active2")
506  })
507
508  //svg 클릭 이벤트 
509  $('.hireService-tab > ul > li').each(function () {
510    var $slide = $(this)
511    var $object = $slide.find('.icon')
512    var $image = $object.closest('img')
513
514    $object.on('load', function () {
515      var object = this
516      var svgDoc = object.contentDocument || object.contentWindow.document
517      var svgRoot = svgDoc.documentElement
518      $(svgRoot).css('cursor', 'pointer')
519    })
520  })
521}
522
523const recruitView = () => {
524  var swiper = new Swiper(".recruitView-cont-slide .swiper", {
525    slidesPerView: 1,
526    // speed: 1000,
527    pagination: {
528      el: ".recruitView-cont-slide .pagination",
529      type: "fraction",
530    },
531    navigation: {
532      nextEl: ".recruitView-cont-slide .next",
533      prevEl: ".recruitView-cont-slide .prev",
534    },
535  })
536
537  // setTimeout(function() {
538  //   const snb = $(".recruitView-infoBox")
539  //   if (snb.length) {
540  //     gsap.to(snb, {
541  //       scrollTrigger: {
542  //         trigger: snb,
543  //         start: "top top+=200",
544  //         end: "bottom center+=200",
545  //         pin: true,
546  //         pinSpacing: false,
547  //         // markers:true,
548  //       }
549  //     })
550  //   }
551  // },400)
552
553  var swiper1 = new Swiper(".recruitView-service-thumbs", {
554    spaceBetween: 5,
555    slidesPerView: 4,
556    freeMode: true,
557    watchSlidesProgress: true,
558    breakpoints: {
559      587: {
560        slidesPerView: 6,
561      }
562    }
563  })
564  var swiper2 = new Swiper(".recruitView-service .swiper", {
565    spaceBetween: 0,
566    pagination: {
567      el: ".recruitView-service .pagination",
568      type: "fraction",
569    },
570    navigation: {
571      nextEl: ".recruitView-service .next",
572      prevEl: ".recruitView-service .prev",
573    },
574    thumbs: {
575      swiper: swiper1,
576    },
577  })
578
579  const modal = $(".recruitView-modal")
580  const agreeBox = modal.find(".agreeBox")
581  const agreeContBtn = modal.find(".agreeBox-top > button")
582
583  agreeContBtn.click(function () {
584    agreeBox.toggleClass("active")
585  })
586
587
588  const $recruitViewV2 = $(".recruitView-top").first().closest("#txt")
589  const $recruitViewV2FixedBtns = $(".recruitView-top-info-list .recruitView-infoBox-btns")
590
591  if (!$(".recruitView-top").length) {
592    $(window).scroll(function () {
593      var scrollTop = $(window).scrollTop()
594
595      if (scrollTop > 0) {
596        $(".recruitView-infoBox").addClass("visible")
597      } else {
598        $(".recruitView-infoBox").removeClass("visible")
599      }
600    })
601  } else if ($recruitViewV2FixedBtns.length) {
602    const toggleRecruitViewV2FixedBtns = () => {
603      if (window.innerWidth > 1024) {
604        $recruitViewV2FixedBtns.removeClass("is-footer-hide")
605        return
606      }
607
608      const scrT = $(window).scrollTop() + ($("#footer").height() / 1.5)
609      const atFooter = scrT > $(document).height() - $(window).height()
610
611      $recruitViewV2FixedBtns.toggleClass("is-footer-hide", atFooter)
612    }
613
614    toggleRecruitViewV2FixedBtns()
615    $(window).on("scroll.recruitViewV2FixedBtns resize.recruitViewV2FixedBtns", toggleRecruitViewV2FixedBtns)
616  }
617
618  $recruitViewV2.find(".recruitView-infoBox-slide").each(function () {
619    const $wrap = $(this)
620    const swiperEl = $wrap.find(".swiper")[0]
621    if (!swiperEl) return
622
623    new Swiper(swiperEl, {
624      slidesPerView: 1,
625      spaceBetween: 0,
626      navigation: {
627        nextEl: $wrap.find(".recruitView-infoBox-slide-btn.next")[0],
628        prevEl: $wrap.find(".recruitView-infoBox-slide-btn.prev")[0],
629      },
630      a11y: {
631        prevSlideMessage: "이전 슬라이드",
632        nextSlideMessage: "다음 슬라이드",
633        slideLabelMessage: "총 {{slidesLength}}장의 슬라이드 중 {{index}}번 슬라이드 입니다.",
634      },
635    })
636  })
637}
638
639const tab = () => {
640  const tab = $(".recruitView-tab")
641  const tabBtn = tab.find("a")
642  const tabCont = $(".recruitView-tab-cont")
643
644  setTimeout(function () {
645    tabCont.css("display", "none")
646  }, 300)
647
648  tabBtn.click(function (e) {
649    e.preventDefault()
650    tabBtn.removeClass("active")
651    $(this).addClass("active")
652
653    const href = $(this).attr("href")
654    tabCont.removeClass("active")
655    tabCont.filter(href).addClass("active")
656  })
657}
658
659const noLayout = () => {
660  if ($(".no-layout").length) {
661    $("#sub > .layout").css({
662      "width": "100%",
663      "margin-bottom": "0"
664      // "margin-top": "-4.7rem"
665    })
666    $(".sub-title").hide()
667  }
668}
669
670const labelingFunction = () => {
671  const container = $('.privacy-index')
672  const item = container.find('li')
673
674  const labelClick = () => {
675    item.each(function (idx, item) {
676
677      const $this = $(item).find('a')
678      const i = idx
679
680      $this.on('click', e => {
681        e.preventDefault()
682
683        const target = $('.privacy-contents > ul > li').eq(i)
684
685        if (target.length) {
686          $('html,body').animate({
687            scrollTop: target.offset().top - 100
688          }, 500)
689        }
690      })
691    })
692  }
693  labelClick()
694}
695
696const kiwoom = () => {
697  var swiper = new Swiper(".kiwoom-bottom .swiper", {
698    spaceBetween: 24,
699    slidesPerView: "auto",
700    freeMode: true,
701    navigation: {
702      nextEl: ".kiwoom-bottom .swiper-button.next",
703      prevEl: ".kiwoom-bottom .swiper-button.prev",
704    },
705    pagination: {
706      el: ".kiwoom-bottom .swiper-pagination",
707      type: "progressbar",
708    },
709    breakpoints: {
710      587: {
711        // slidesPerView: 6,
712      }
713    },
714  })
715}
716
717
718
719$(function () {
720  $(".select select").chosen({
721    disable_search: true
722  })
723  subVisual()
724  recruitSearch()
725  date()
726  apply()
727  componentTab()
728  modal()
729  resume()
730  form()
731  hireService()
732  recruitView()
733  tab()
734  noLayout()
735  labelingFunction()
736  kiwoom()
737})

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.