PageSourceSearch

https://apm.biff.kr/eng/layout/js/jquery.common.js?3830105635

js biff.kr collected 2026-10-02 04:14:33 UTC 9,669 bytes, 374 lines download raw bytes

1// 엘리먼트 휠스크롤 플러그인
2jQuery(function ($) {
3  $.fn.hScroll = function (amount) {
4    amount = amount || 120;
5    $(this).bind('DOMMouseScroll mousewheel', function (event) {
6      var oEvent = event.originalEvent,
7        direction = oEvent.detail ? oEvent.detail * -amount : oEvent.wheelDelta,
8        position = $(this).scrollLeft();
9      position += direction > 0 ? -amount : amount;
10      $(this).scrollLeft(position);
11      event.preventDefault();
12    });
13  };
14});
15
16// 부드러운 스크롤 모션
17new GambitSmoothScroll({ amount: 50, speed: 950, force: 3 });
18
19// 선택영역 이 외의 요소 클릭시 이벤트
20$(document).mouseup(function (e) {
21  var LayerPopup = $('.pop');
22  if (LayerPopup.has(e.target).length === 0) {
23    $('.pop').fadeOut(200);
24  }
25});
26
27$(document).ready(function () {
28  try {
29    // 새로고침 및 초기 접속 시 스크롤 최상단 유지
30    $('html, body').stop().animate({ scrollTop: 0 }, 500, 'easeInCubic');
31
32    // 언어선택
33    var isToggled = false;
34    $('.lang > button').click(function () {
35      if (!isToggled) {
36        $(this).addClass('active');
37        isToggled = true;
38      } else {
39        $(this).removeClass('active');
40        isToggled = false;
41      }
42    });
43
44    // 스크롤 매직 옵션
45    var controller = new ScrollMagic.Controller({
46      globalSceneOptions: {
47        triggerHook: 'onLeave',
48      },
49    });
50
51    // 해더 스크롤 시 고정
52    var pin = new ScrollMagic.Scene({
53      triggerElement: '#nav',
54    })
55      .setPin('#nav', { pushFollowers: false })
56      .setClassToggle('#nav', 'scrolled')
57      .addTo(controller);
58
59	  $('.qna button').click(function(){
60      $(this).toggleClass('active');
61      $(this).next('p').slideToggle(200);
62    });
63  } catch (e) {
64    console.error('Error : ' + e.stack);
65  }
66
67  tableScroll();
68});
69
70//header
71$(function () {
72  var win = $(window),
73    winHeight = win.height(),
74    winWidth = win.width();
75
76  /* ON LOAD */
77  $(window).on('load', function () {
78    setTimeout(function () {
79      $('body').addClass('opacity');
80    }, 0);
81
82    var gnb = $('.navigation nav').html();
83    autoHeight();
84  });
85
86  /* resize Fn */
87  var delta = 0;
88  var timer = null;
89
90  function resizeFn() {
91    winSize();
92    winPcReset();
93    gnbOpen();
94  }
95  $(window).on('resize', function () {
96    clearTimeout(timer);
97    timer = setTimeout(resizeFn, delta);
98  });
99
100  /* run */
101  initFn();
102
103  /* initFn */
104  function initFn() {
105    // resizeFn
106    winSize();
107    winPcReset();
108    gnbOpen();
109
110    // common
111    menuOpen();
112  }
113
114  /* function : custom */
115  // viewport addclass : mobile or desktop
116  function winSize() {
117    if (win.width() <= 1024) {
118      $('html').removeClass('desktop').addClass('mobile');
119    } else {
120      $('html').removeClass('mobile').addClass('desktop');
121    }
122  }
123  // viewport reset class
124  function winPcReset() {
125    if (!$('html').hasClass('mobile')) {
126      $('body, .header-menu-btn').removeClass('menu-open');
127      $('.gnb, .gnb .submenu').removeAttr('style');
128      $('.gnb > li').removeClass('toggle active');
129
130      $('body').removeClass('sideMenu');
131      $('.all-menu-mask, .all-menu-layer-wrap').removeClass('menu-open');
132    } else {
133      $('body').removeClass('popshow');
134    }
135  }
136  // header menu button click
137  function menuOpen() {
138    var button = $('.header-menu-btn');
139    var check = true;
140
141    button.on('click', function () {
142      if (check) {
143        $('body').addClass('menu-open');
144        $(this).addClass('menu-open');
145        check = false;
146      } else {
147        setTimeout(function () {
148          $('body').removeClass('menu-open');
149        }, 200);
150        $(this).removeClass('menu-open');
151        check = true;
152      }
153    });
154  }
155  // gnb mobile menu open
156  function gnbOpen() {
157    if ($('html').hasClass('mobile')) {
158      $('.gnb').unbind('mouseenter mouseleave');
159      gnbMobile();
160    } else {
161      $('.gnb > li > a').unbind('click');
162      $('.gnb').bind('mouseenter mouseleave');
163      gnbPc();
164    }
165
166    function gnbMobile() {
167      $('.gnb > li').each(function () {
168        if ($(this).find('ul').length > 0) {
169          $(this).addClass('toggle');
170        }
171      });
172      $('.gnb > li > a')
173        .unbind()
174        .bind('click', function () {
175          if ($(this).parent().find('ul').length > 0) {
176            $(this).parent().toggleClass('active');
177            $(this).parent().find('ul').stop().slideToggle();
178            return false;
179          }
180        });
181    }
182    function gnbPc() {
183      $('.gnb').hover(
184        function () {
185          $('body').addClass('menu-open');
186        },
187        function () {
188          $('body').removeClass('menu-open');
189        },
190      );
191    }
192  }
193});
194// div height auto
195function autoHeight() {
196  var $item = $('.menu-content .gnb > li, .cube-list > li, .vision-list > li');
197
198  if ($('body').find($item).length) {
199    // element
200    // init
201    match_height();
202    // resize
203    $(window).resize(match_height);
204
205    function match_height() {
206      var currentTallest = 0,
207        currentRowStart = 0,
208        rowDivs = new Array(),
209        $el,
210        topPosition = 0;
211
212      $item.each(function () {
213        $el = $(this);
214        $el.height('auto');
215        topPostion = $el.position().top;
216
217        if (currentRowStart != topPostion) {
218          for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) {
219            rowDivs[currentDiv].height(currentTallest);
220          }
221          rowDivs.length = 0;
222          currentRowStart = topPostion;
223          currentTallest = $el.height();
224          rowDivs.push($el);
225        } else {
226          rowDivs.push($el);
227          currentTallest = currentTallest < $el.height() ? $el.height() : currentTallest;
228        }
229
230        for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) {
231          rowDivs[currentDiv].height(currentTallest);
232        }
233      });
234    }
235  }
236}
237
238//scroll down
239$(function () {
240  $('.scrolldown').click(function () {
241    $('html, body').animate({ scrollTop: $('.contents').offset().top }, 'slow');
242    return false;
243  });
244});
245
246//visual animation
247$(function () {
248  setTimeout(function () {
249    $('.visual .visual-txt').children('em').addClass('show');
250    $('.visual .visual-txt').children('p').addClass('show');
251    $('.visual').children('a').addClass('show');
252  }, 200);
253});
254
255//project slide
256$(function () {
257  new Swiper('.area-project .swiper-container', {
258    slidesPerView: 1,
259    spaceBetween: 0,
260    slidesPerGroup: 1,
261    centeredSlides: false,
262    loop: true,
263    autoplay: {
264      delay: 2500,
265      disableOnInteraction: false,
266    },
267/*    pagination: {
268      el: '.area-project .swiper-pagination',
269      clickable: true,
270    },*/
271    navigation: {
272      nextEl: '.area-project .swiper-button-next',
273      prevEl: '.area-project .swiper-button-prev',
274    },
275    on: {
276      init: function () {
277        thisSlide = this;
278        autoPlayBtn = document.querySelector('.area-project .swiper-autoplay-control > button');
279        autoPlayBtn.addEventListener('click', e => {
280          autoPlayState = autoPlayBtn.getAttribute('autoplay-pressed');
281          if (autoPlayState === 'false') {
282            autoPlayBtn.setAttribute('autoplay-pressed', 'true');
283            thisSlide.autoplay.stop();
284          } else if (autoPlayState === 'true') {
285            autoPlayBtn.setAttribute('autoplay-pressed', 'false');
286            thisSlide.autoplay.start();
287          }
288        });
289      },
290    },
291    breakpoints: {
292      1280: {
293        slidesPerView: 2,
294        spaceBetween: 40,
295      },
296      768: {
297        slidesPerView: 2,
298        spaceBetween: 20,
299      },
300    },
301    observer: true,
302    observeParents: true,
303  });
304});
305
306//archive slide
307$(function () {
308  new Swiper('.area-archive .swiper-container', {
309    slidesPerView: 3,
310    spaceBetween: 10,
311    slidesPerGroup: 1,
312    centeredSlides: false,
313    loop: true,
314    autoplay: {
315      delay: 2500,
316      disableOnInteraction: false,
317    },
318    breakpoints: {
319      1400: {
320        slidesPerView: 7,
321        spaceBetween: 40,
322      },
323      1280: {
324        slidesPerView: 6,
325        spaceBetween: 30,
326      },
327      768: {
328        slidesPerView: 5,
329        spaceBetween: 20,
330      },
331      480: {
332        slidesPerView: 4,
333        spaceBetween: 10,
334      },
335    },
336    observer: true,
337    observeParents: true,
338  });
339});
340
341//sub text fadeup
342$(function () {
343  setTimeout(function () {
344    $('.visual-txt, .lnb').addClass('active');
345  }, 200);
346});
347
348//table scroll
349function tableScroll() {
350  if (!($('table.tbscroll').length > 0)) return;
351  $('table.tbscroll').wrap('<div class="scrollTable"></div>');
352  $('.scrollTable').after('<p class="mob_info">You can scroll left and right to view the content.</p>');
353}
354
355//2025-06-26 모바일에서 텝메뉴 x스크롤
356$(function () {
357    function scrollToActiveTab(attempts = 10) {
358        const $on = $('#side3m_ li.on');
359        const $wrap = $('#side3m_');
360
361        if ($on.length && $wrap.length) {
362            const left = $on.offset().left;
363            const baseLeft = $wrap.offset().left;
364
365            if (left > 0) {
366                $wrap.scrollLeft(left - baseLeft - 40);
367            } else if (attempts > 0) {
368                requestAnimationFrame(() => scrollToActiveTab(attempts - 1));
369            }
370        }
371    }
372
373    scrollToActiveTab();
374});

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.