PageSourceSearch

https://www.nttdata-lifedesign.com/assets/js/common.js

js nttdata-lifedesign.com collected 2026-10-06 14:10:12 UTC 45,825 bytes, 1,238 lines download raw bytes

1(function($){
2
3// 共通変数
4const $window = $(window);
5const mql = window.matchMedia('(max-width: 767px)');
6const $body = $('body');
7
8/*---------------------------------
9// デバイス、OS、ブラウザ判定用
10---------------------------------*/
11var ua = window.navigator.userAgent.toLowerCase();
12
13// デバイス判定
14function getDevice(){
15  if(ua.indexOf('iphone') > 0 || ua.indexOf('ipod') > 0 || ua.indexOf('android') > 0 && ua.indexOf('mobile') > 0 || ua.indexOf('windows phone') > 0){
16    return 'sp';
17  }else if(ua.indexOf('ipad') > 0 || ua.indexOf('android') > 0){
18    return 'tab';
19  }else{
20    return 'pc';
21  }
22}
23
24// OS判定
25  function getOs(){
26  if(ua.indexOf('iphone') > 0 || ua.indexOf('ipod') > 0 || ua.indexOf('ipad') > 0){
27    return 'ios';
28  }else if(ua.indexOf('android') > 0){
29    return 'android';
30  }
31}
32
33// ブラウザ判定
34function getBrowser(){
35  if(ua.indexOf('msie') > 0 || ua.indexOf('trident') > 0){
36    return 'ie';
37  }else if(ua.indexOf('edge') > 0){
38    return 'edge';
39  }else if(ua.indexOf('chrome') > 0){
40    return 'chrome';
41  }else if(ua.indexOf('safari') > 0){
42    return 'safari';
43  }else if(ua.indexOf('safari') > 0){
44    return 'safari';
45  }else if(ua.indexOf('firefox') > 0){
46    return 'firefox';
47  }
48}
49
50/*---------------------------------
51// タブレット時のViewport切り替え
52---------------------------------*/
53/* 2024/3/31 まで使われなければ削除 
54$(function(){
55  var contentWidth = 1000;
56  if(getDevice() == 'tab'){
57    document.querySelector('meta[name="viewport"]').setAttribute('content', 'width=' + contentWidth);
58  }
59});
60*/
61
62/*---------------------------------
63// ヘッダーPCメニュー(APAC)
64---------------------------------*/
65$(function(){
66  var lastWidthPC = $(window).width();
67
68  $(document).on('click', '.l-header__nav > ul > li:not(.is-no-menu) > span, .l-header__nav > ul > li:not(.is-no-menu) > a', function(e){
69    if(window.matchMedia('(min-width: 1360px)').matches){
70      e.preventDefault();
71      var index = $(this).parent().index();
72      $('.l-header').addClass('is-menu-open');
73      $('.l-header__nav > ul > li').removeClass('is-open');
74      $(this).parent().addClass('is-open');
75      $('.l-header__menu-nav > ul > li').removeClass('is-open');
76      $('.l-header__menu-nav > ul > li').eq(index).addClass('is-open');
77    }
78  });
79  $(document).on('click', function(e){
80    if(window.matchMedia('(min-width: 1360px)').matches){
81      if($('.l-header').hasClass('is-menu-open') && !$(e.target).closest('.l-header__nav').length && !$(e.target).closest('.l-header__menu').length) {
82        $('.l-header').removeClass('is-menu-open');
83        $('.l-header__nav > ul > li').removeClass('is-open');
84        $('.l-header__menu-nav > ul > li').removeClass('is-open');
85      }
86    }
87    // 検索窓を閉じる
88    if($('.l-header').hasClass('is-search-open') && !$(e.target).closest('.l-header__ico-search').length && !$(e.target).closest('.l-header__search__inner').length) {
89      $('.l-header').removeClass('is-search-open');
90    }
91  });
92  $(window).on('resize', function(){
93    setTimeout(function(){
94      if(lastWidthPC != $(window).width()){
95        $('.l-header').removeClass('is-menu-open');
96        $('.l-header__nav > ul > li').removeClass('is-open');
97        $('.l-header__menu-nav ul li').removeClass('is-open');
98        // 検索窓を閉じる
99        $('.l-header').removeClass('is-search-open');
100        if(window.matchMedia('(min-width: 1360px)').matches){
101          $('.l-header__menu-nav > ul > li a[onclick]').each(function(){
102            $(this).attr('onclick', '');
103          });
104        }
105        lastWidthPC = $(window).width();
106      }
107    }, 0);
108  });
109});
110
111/*---------------------------------
112// ヘッダーSPメニュー(APAC)
113---------------------------------*/
114$(function(){
115  var lastWidthSP = $(window).width();
116
117  function checkIcon() {
118    if(window.matchMedia('(max-width: 1359px)').matches){
119      $('.l-header__menu-nav li').each(function(){
120        if(!$(this).find('ul').length){
121          $(this).addClass('is-no-icon');
122        }
123      });
124      $('.l-header__menu-nav > ul > li a').each(function(){
125        if($(this).parent().find('ul').length){
126          $(this).attr('onclick', 'return false;');
127        }
128      });
129    }
130  }
131  checkIcon();
132
133  $(document).on('click', '.l-header__ico-menu', function(){
134    if(window.matchMedia('(max-width: 1359px)').matches){
135      $('.l-header').removeClass('is-search-open');
136      $('.l-header').toggleClass('is-menu-open');
137    }
138  });
139  $(document).on('click', '.l-header__menu-nav > ul > li:not(.is-no-icon) > a, .l-header__menu-nav > ul > li:not(.is-no-icon) > span, .l-header__menu-nav > ul > li > ul > li:not(.is-no-icon) > a, .l-header__menu-nav > ul > li > ul > li:not(.is-no-icon) > span', function(e){
140    if(window.matchMedia('(max-width: 1359px)').matches){
141      e.preventDefault();
142      $(this).parent().toggleClass('is-open');
143      $(this).next().slideToggle();
144    }
145  });
146
147  $(window).on('resize', function(){
148    setTimeout(function(){
149      if(lastWidthSP != $(window).width()){
150        $('.l-header').removeClass('is-open');
151        $('.l-header__menu-nav li.is-open').removeClass('is-open');
152        $('.l-header__menu-nav ul').css({'display': ''});
153        if(window.matchMedia('(max-width: 1359px)').matches){
154          checkIcon();
155        }
156        lastWidthSP = $(window).width();
157      }
158    }, 0);
159  });
160});
161
162/*---------------------------------
163// ヘッダー(2023/12改修)
164// GroupEN・GroupJP・日本
165---------------------------------*/
166
167  /*---------------------------------
168  // ヘッダー共通
169  ---------------------------------*/
170  // メニューのアイコン不要チェック
171  function checkIcon() {
172    $('.l-header-ed23__nav-main__item').each(function(){
173      if(!$(this).find('ul').length && !$(this).find('a').hasClass('c-btn-text-external')){
174        $(this).addClass('is-no-icon');
175      }
176    });
177  }
178  if($('.l-header-ed23__nav-main__second-item__low-title').length > 0) {
179    checkIcon();
180  }
181
182  // Level2階層タイトルのviewport別buttonとspanタグ変更処理
183  function changeBtn() {
184    $('.l-header-ed23__nav-main__second-item__low-title').each(function(i){
185      if(window.matchMedia('(min-width: 1250px)').matches){
186        $(this).next().removeAttr('id');
187        $(this).replaceWith('<span class="l-header-ed23__nav-main__second-item__low-title">' + $(this).text() + '</span>');
188      } else {
189        $(this).next().attr('id','toggle-ul-' + (i+1));
190        $(this).replaceWith('<button type="button" aria-controls="toggle-ul-' + (i+1) +  '" aria-expanded="false" class="l-header-ed23__nav-main__second-item__low-title">' + $(this).text() + '</button>');
191      }
192    });
193  }
194  if($('.l-header-ed23__nav-main__second-item__low-title').length > 0) {
195    changeBtn();
196  }
197
198  // PC表示時にメニュー2個を縦並びにするためのwrap処理
199  function listWrap() {
200    $('.is-wrapped-item:not(.l-header-ed23__nav-main__second-item--large)').each(function(){
201      let wrapPrev = $(this).prev();
202      if(!wrapPrev.hasClass('l-header-ed23__nav-main__second-item--large')) {
203        wrapPrev.wrap('<li class="l-header-ed23__nav-main__second-item is-wrap"><ul></ul></li>');
204        $(this).insertAfter(wrapPrev);
205      }
206    });
207  }
208  if($('.is-wrapped-item').length > 0) {
209    listWrap();
210  }
211
212  // メニューの閉じ処理
213  function menuClose() {
214    const $headerEd23 = $('.l-header-ed23');
215    const $menuBtn = $('.l-header-ed23__ico-menu > button');
216    $headerEd23.removeClass('is-menu-open');
217    $('.l-header-ed23__nav-main__item').removeClass('is-open');
218    $('.l-header-ed23__nav-main__item > button').attr('aria-expanded', 'false');
219    if(window.matchMedia('(max-width: 1249px)').matches){
220      $('.l-header-ed23__nav-main__second-item').removeClass('is-open');
221      $('.l-header-ed23__nav-main__second-item > button').attr('aria-expanded', 'false');
222      $menuBtn.attr('aria-expanded', 'false')
223      if($headerEd23.hasClass('is-jp')) {
224        $menuBtn.attr('aria-label', 'メニューを開く');
225      } else {
226        $menuBtn.attr('aria-label', 'Menu Open');
227      }
228    }
229    setTimeout(function(){
230      $menuBtn.focus();
231    }, 0);
232  }
233
234  // 検索閉じ処理
235  function searchClose() {
236    const $searchBtn = $('.l-header-ed23__search-btn');
237    $('.l-header-ed23').removeClass('is-search-open');
238    $searchBtn.attr('aria-expanded', 'false');
239    setTimeout(function(){
240      $searchBtn.focus();
241    }, 0);
242  }
243
244  // リサイズでメニューを閉じる
245  $(window).on('resize', function(){
246    changeBtn();
247    setTimeout(function(){
248      if($('.l-header-ed23').hasClass('is-menu-open')){
249        menuClose();
250      }
251      if (!navigator.userAgent.match(/Android/)) {
252        if($('.l-header-ed23').hasClass('is-search-open')) {
253          searchClose();
254        }
255      }
256    }, 0);
257  });
258
259  // 領域外クリックでメニューを閉じる
260  $(document).on('click', function(e){
261    // メニュー
262    if($('.l-header-ed23').hasClass('is-menu-open')){ 
263      if(window.matchMedia('(min-width: 1250px)').matches){
264        if(!$(e.target).closest('.l-header-ed23__nav-main__item').length && !$(e.target).closest('.l-header-ed23__ico-menu').length) {
265          menuClose();
266        }
267      } else {
268        if(!$(e.target).closest('.l-header-ed23__nav').length && !$(e.target).closest('.l-header-ed23__ico-menu').length) {
269          menuClose();
270        }
271      }
272    }
273    // 検索
274    if($('.l-header-ed23').hasClass('is-search-open') && !$(e.target).closest('.l-header-ed23__ico-search').length && !$(e.target).closest('.l-header-ed23__search').length) {
275      searchClose();
276    }
277  });
278
279  // Escキーで閉じる
280  $(window).keyup(function(e){
281    if(e.keyCode == 27){
282      if($('.l-header-ed23').hasClass('is-menu-open')){
283        menuClose();
284      } else if($('.l-header-ed23').hasClass('is-search-open')){
285        searchClose();
286      }
287    }
288  });
289
290  //現在開いているメニューからタブが外れたら、メニューを閉じる
291  const $headerEd23NavMainItem = $('.l-header-ed23__nav-main__item');
292  $headerEd23NavMainItem.focusin(function() {
293    if (!$(this).hasClass('is-open') && window.matchMedia('(min-width: 1250px)').matches) {
294      $('.l-header-ed23').removeClass('is-menu-open');
295      $headerEd23NavMainItem.removeClass('is-open');
296      $('.l-header-ed23__nav-main__item > button').attr('aria-expanded', 'false');
297    }
298  });
299
300  // メニューの開閉
301  $(document).on('click', '.l-header-ed23__nav-main__item > button', function(){
302    $(this).parent().toggleClass('is-open');
303    if(window.matchMedia('(min-width: 1250px)').matches){
304      $(this).parent().siblings().removeClass('is-open');
305      $(this).parent().siblings().find('button').attr('aria-expanded', 'false');
306      if($(this).parent().hasClass('is-open') || $(this).parent().siblings().hasClass('is-open')) {
307        $('.l-header-ed23').addClass('is-menu-open');
308      } else {
309        $('.l-header-ed23').removeClass('is-menu-open');
310      }
311    }
312    if($(this).parent().hasClass('is-open')) {
313      $(this).attr('aria-expanded', 'true');
314    } else {
315      $(this).attr('aria-expanded', 'false');
316    }
317  });
318
319  /*---------------------------------
320  // ヘッダーPCメニュー
321  ---------------------------------*/
322  var lastWidthPC = $(window).width();
323
324  $(document).on('click', '.l-header-ed23__nav-main__item > button', function(){
325    if(window.matchMedia('(min-width: 1250px)').matches){
326      if($(this).siblings().find('.l-header-ed23__nav-main__second-item--large').length){
327        $(this).siblings().find('.l-header-ed23__nav-main__second').css('padding-top', '82px');
328        $(this).siblings().find('.l-header-ed23__nav-main__second__side').css('margin-top', '82px');
329        if($(this).siblings().find('.l-header-ed23__nav-main__second--4column').length) {
330          $(this).siblings().find('.l-header-ed23__nav-main__second-item:has(.l-header-ed23__nav-main__second-item > ul):nth-child(5)').addClass('u-mt-0');
331        } else {
332          $(this).siblings().find('.l-header-ed23__nav-main__second-item:has(.l-header-ed23__nav-main__second-item > ul):nth-child(4)').addClass('u-mt-0');
333        }
334      }
335    }
336  });
337
338  $(window).on('resize', function(){
339    setTimeout(function(){
340      if(lastWidthPC != $(window).width()){
341        if(window.matchMedia('(min-width: 1250px)').matches){
342          $('.l-header-ed23__nav-main__second').css('padding-top', '0');
343          $('#navigation').attr('tabindex', '-1');
344        } else {
345          $('.l-header-ed23__nav-main__second').css('padding-top', '10px');
346        }
347        lastWidthPC = $(window).width();
348      }
349    }, 0);
350  });
351
352  /*---------------------------------
353  // ヘッダーSPメニュー
354  ---------------------------------*/
355  // ハンバーガーメニュー
356  $(document).on('click', '.l-header-ed23__ico-menu', function(){
357    if(window.matchMedia('(max-width: 1249px)').matches){
358      $('.l-header-ed23').toggleClass('is-menu-open');
359      if($('.l-header-ed23').hasClass('is-menu-open')) {
360        $('.l-header-ed23__ico-menu > button').attr('aria-expanded', 'true')
361        if($('.l-header-ed23').hasClass('is-jp')) {
362          $('.l-header-ed23__ico-menu > button').attr('aria-label', 'メニューを閉じる');
363        } else {
364          $('.l-header-ed23__ico-menu > button').attr('aria-label', 'Menu Close');
365        }
366        $('#navigation').attr('tabindex', '0');
367        setTimeout(function(){
368          $('#navigation').focus();
369        },0);
370      } else {
371        menuClose();
372      }
373    }
374  });
375
376  // Level2階層の開閉
377  $(document).on('click', '.l-header-ed23__nav-main__second-item > button', function(){
378    if(window.matchMedia('(max-width: 1249px)').matches){
379      $(this).parent().toggleClass('is-open');
380      if($(this).parent().hasClass('is-open')) {
381        $(this).attr('aria-expanded', 'true');
382      } else {
383        $(this).attr('aria-expanded', 'false');
384      }
385    }
386  });
387
388  /*---------------------------------
389  // ヘッダー検索ボタン
390  ---------------------------------*/
391  $(document).on('click', '.l-header-ed23__search-btn', function(){
392    $('.l-header-ed23').addClass('is-search-open');
393    $('.l-header-ed23__search-btn').attr('aria-expanded', 'true');
394    $('.l-header__search-form__select').removeClass('is-show');
395    $('.p-content-header__overlay').removeClass('is-show');
396    $(this).siblings('.l-header-ed23__search__inner').children('.p-content-header__overlay').addClass('is-show');
397    $('#search .l-header__search-form').find('.l-header__search-form__input').focus();
398  });
399
400  //ブラウザバック時に表示を初期化
401  window.onpageshow = function() {
402    $('.l-header-ed23__search-btn').attr('aria-expanded', 'false');
403  }
404
405  //背景動画ヘッダー 動画制御
406  $(function () {
407    const videoElement = $('.p-content-header__mv').get(0);
408    $('.js-header__movie--switch-play').on('click', function () {
409      videoElement.play();
410      $('.js-header__movie--switch-play').hide();
411      $('.js-header__movie--switch-pause').show();
412    });
413    $('.js-header__movie--switch-pause').on('click', function () {
414      videoElement.pause();
415      $('.js-header__movie--switch-pause').hide();
416      $('.js-header__movie--switch-play').show();
417    });
418  });
419
420// ヘッダーここまで
421/*---------------------------------
422// フッターTOPボタン
423---------------------------------*/
424$(function(){
425  function checkfotterPageTopScroll() {
426    if($(window).scrollTop() > 0){
427      $('.l-footer__page-top').addClass('is-scroll');
428    }else{
429      $('.l-footer__page-top').removeClass('is-scroll');
430    }
431    if(window.matchMedia('(min-width: 768px)').matches){
432      if($('.l-footer__lower').length){
433        if($(window).scrollTop() + $(window).outerHeight() > $('.l-footer__lower').offset().top){
434          $('.l-footer__page-top').addClass('is-bottom');
435        }else{
436          $('.l-footer__page-top').removeClass('is-bottom');
437        }
438      }
439    }
440  }
441  checkfotterPageTopScroll();
442  $(window).on('scroll', function(){
443    checkfotterPageTopScroll();
444  });
445});
446
447/*---------------------------------
448// フッター Regional用 Country Selector 
449---------------------------------*/
450$(function(){
451  if($('.l-footer__upper__country').length > 0) {
452    let path = location.pathname;
453    if(path.match('/jp/ja/')) {
454      $('.l-footer__upper__country').addClass('is-regional');
455    }
456  
457    let footerLogo = $('.l-footer__upper__logo').find('img').attr('src');
458    if(footerLogo.match('dynamic')){
459      $('.l-footer__upper__country').addClass('is-regional');
460    }
461  }
462});
463
464/*---------------------------------
465// アコーディオン
466---------------------------------*/
467$(function(){
468  $(document).on('click', '.c-btn-accordion > *:first-child', function(){
469    $(this).closest('.c-btn-accordion').toggleClass('is-open');
470    $(this).closest('.c-btn-accordion').children('*:last-child').slideToggle();
471    if($(this).closest('.c-btn-accordion').hasClass('is-open')) {
472      $(this).attr('aria-expanded','true');
473    } else {
474      $(this).attr('aria-expanded','false');
475    }
476  });
477  $(document).on('click', '.js-accordion-btn', function(){
478    const jsAccordion = $(this).closest('.js-accordion');
479    jsAccordion.toggleClass('is-open');
480    jsAccordion.find('.js-accordion-open').slideToggle();
481
482    /* Open時のフォーカス指定 */
483    const target = jsAccordion.find('.js-accordion-open');
484    if(jsAccordion.hasClass('is-open')) {
485      target.attr('tabindex', '0');
486      setTimeout(function(){
487        target.focus();
488      }, 0);
489    } else {
490      target.attr('tabindex', '-1');
491      $(this).focus();
492    };
493  });
494});
495
496
497/*---------------------------------
498// モーダル
499---------------------------------*/
500$(function(){
501  $(document).on('click', '.js-modal', function(){
502    const modalId = $(this).attr('href').replace('#', '');
503    const $modalElement = $(`.p-modal[id=${modalId}]`);
504    const $modalElementInner = $(`.p-modal[id=${modalId}] .p-modal__inner`);
505    $modalElement.attr('role','dialog');
506    $modalElement.attr('aria-modal','true');
507    $modalElement.attr('aria-hidden','false');
508    $modalElement.fadeIn().css('display', 'flex');
509    $modalElementInner.attr('tabindex', '0');
510    setTimeout(function(){
511      $modalElementInner.focus();
512    }, 0);
513
514    // modalオープン時、focus移動を制限
515    $(document).keydown(function(event) {
516      const modalMenuElements = $modalElement.find( 'a, button' ); // modal内でfocusを当てたい要素
517      if ($('.p-modal[aria-modal="true"]')) {
518        // modalが開かれていた場合
519        const activeEl = document.activeElement; // focusが当たっている要素
520        const firstEl = modalMenuElements[0]; // focusを当てたい最初の要素
521        const lastEl = modalMenuElements[ modalMenuElements.length - 1 ]; // focusを当てたい最後の要素
522        const tabKey = ( 9 === event.keyCode );// tabを押されたかどうか
523        const shiftKey = event.shiftKey;// Shiftが押されているかどうか
524        if (!shiftKey && tabKey && lastEl === activeEl) {
525          // 最後の要素でtabが押された場合は、最初の要素にfocusを当てる
526          event.preventDefault();
527          firstEl.focus();
528        }
529        if (shiftKey && tabKey && firstEl === activeEl) {
530          // 最初の要素でタブキー+Shiftキーが押された場合は、最後の要素にfocusを当てる
531          event.preventDefault();
532          lastEl.focus();
533        }
534      }
535    });
536    return false;
537  });
538
539  $(document).on('click', '.p-modal, .p-modal__close', function(){
540    const modalId = $(this).closest('.p-modal').attr('id');
541    const $modalElement = $(`.p-modal[id=${modalId}]`);
542    const $modalAnkerlink = $(`a[href="#${modalId}"]`);
543    $modalElement.removeAttr('role');
544    $modalElement.removeAttr('aria-modal');
545    $modalElement.attr('aria-hidden','true');
546    $modalElement.fadeOut();
547    $modalAnkerlink.focus();
548    
549    /* Youtube動画が存在する場合停止する */
550    if($(this).closest('.p-modal').find('.c-youtube').length){
551      let src = $(this).closest('.p-modal').find('.c-youtube').find('iframe').attr('src').replace('autoplay=1', 'autoplay=0');
552      $(this).closest('.p-modal').find('.c-youtube').find('iframe').attr('src', '');
553      $(this).closest('.p-modal').find('.c-youtube').find('iframe').attr('src', src);
554    }
555  });
556  $(document).on('click', '.p-modal__inner', function(e){
557    e.stopPropagation();
558  });
559});
560
561/*---------------------------------
562// カルーセル
563---------------------------------*/
564$(function(){
565  $('.responsive').slick({
566    dots: true,
567    infinite: false,
568    speed: 300,
569    slidesToShow: 4,
570    slidesToScroll: 4,
571    responsive: [
572      {
573        breakpoint: 1024,
574        settings: {
575          slidesToShow: 3,
576          slidesToScroll: 3,
577          infinite: true,
578          dots: true
579        }
580      },
581      {
582        breakpoint: 600,
583        settings: {
584          slidesToShow: 2,
585          slidesToScroll: 2
586        }
587      },
588      {
589        breakpoint: 480,
590        settings: {
591          slidesToShow: 1,
592          slidesToScroll: 1
593        }
594      }
595      // You can unslick at a given breakpoint now by adding:
596      // settings: "unslick"
597      // instead of a settings object
598    ]
599  });
600});
601
602/* 以下下層パーツ用 */
603/*---------------------------------
604// コンテンツヘッダー SNSシェアボタン
605---------------------------------*/
606$(function(){
607  const $share = $('.c-link-share');
608  const $shareText = $('.c-link-share-text');
609  const $snsButton = $('.c-link-share-button');
610  const shareShowText = $('.l-header').length ? 'Displaying' : $('.l-header-ed23').hasClass('is-jp') ? '表示中': 'Displaying';
611  const shareHiddenText = $('.l-header').length ? 'Not displayed' : $('.l-header-ed23').hasClass('is-jp') ? '非表示中': 'Not displayed';
612  if($share.length) {
613    $shareText.find('.u-visually-hidden').text(shareHiddenText);
614  }
615
616  $(document).on('click', function(e){
617    if($(e.target).closest($shareText).length && !$share.hasClass('is-open')){
618      $share.addClass('is-open');
619      $snsButton.attr('aria-hidden', 'false');
620      $snsButton.attr('tabindex', '0');
621      $shareText.find('.u-visually-hidden').text(shareShowText);
622    }else if(!$(e.target).closest($snsButton).length && $share.hasClass('is-open')){
623      $share.removeClass('is-open');
624      $snsButton.attr('aria-hidden', 'true');
625      $snsButton.attr('tabindex', '-1');
626      $shareText.find('.u-visually-hidden').text(shareHiddenText);
627    }
628  });
629
630  $(document).on('click', ".st-custom-button", function(){
631    const sns = $(this).data('network');
632    var size = "";
633    var snsUrl = "";
634    var currentUrl = window.location.href;
635    var title = $("meta[property='og:title']").attr('content');
636    var pageHeight = document.documentElement.clientHeight;
637    var pageWidth = document.documentElement.clientWidth;
638    switch(sns){
639      case "facebook":
640        size = "menubar=no, toolbar=no, resizable=yes, scrollbars=no, height=" + Math.min(500, .6 * pageHeight) + ", width=" 
640+ Math.min(800, .8 * pageWidth);
641        snsUrl = "//www.facebook.com/sharer.php?t=" + title + "&u=" + currentUrl;
642        break;
643      case "linkedin":
644        size = "menubar=no, toolbar=no, resizable=yes, scrollbars=yes, height=" + Math.min(600, .6 * pageHeight) + ", width=" + Math.min(800, .8 * pageWidth);
645        // linkedinは個々のパラメータ事にエンコードをする必要がある
646        var sessionRedirect = encodeURIComponent("https://www.linkedin.com/shareArticle?title=");
647        var encTitle = encodeURIComponent(title);
648        var encCurrentUrl = encodeURIComponent(currentUrl);
649        snsUrl = "//www.linkedin.com/uas/login?session_redirect=" + sessionRedirect + encodeURIComponent(encTitle + "&url=" + encCurrentUrl);
650        // シェア画面の新規ウインドウを表示(linkedin用)
651        window.open(snsUrl, '_blank', size);
652        return;
653        break;
654      case "twitter":
655        size = "menubar=no, toolbar=no, resizable=yes, scrollbars=yes, height=" + Math.min(500, .6 * pageHeight) + ", width=" + Math.min(800, .8 * pageWidth);
656        snsUrl = "//twitter.com/share?text=" + title + "&url=" + currentUrl;
657        break;
658      case "line":
659        size = "menubar=no, toolbar=no, resizable=yes, scrollbars=yes, height=" + Math.min(500, .6 * pageHeight) + ", width=" + Math.min(350, .8 * pageWidth);
660        snsUrl = "//line.me/R/msg/text/?" + currentUrl;
661        break;
662      case "email":
663        var address = "";
664        var subject = "I'd like to share a link with you";
665        var body = currentUrl;
666        location.href = 'mailto:' + address + '?subject=' + subject + '&body=' + body;
667        return;
668        break;
669      default:
670        return;
671        break;
672    }
673    // シェア画面の新規ウインドウを表示
674    window.open(encodeURI(snsUrl), '_blank', size);
675  });
676
677});
678
679/*---------------------------------
680// ナビゲーションリンクの表示切替
681---------------------------------*/
682// 2023/08/29 修正
683$(function(){
684  // 2024/3/31 まで使われなければ削除
685  // if($('.p-block.p-block--navigation').hasClass('js-sticky')){
686  // }else{
687  //   $('.p-block.p-block--navigation').addClass('js-sticky');
688  // }
689  let currentWidth = window.innerWidth;
690  const navAccessibilityText = $('.l-header-ed23').hasClass('is-jp') ? '各記事へのリンクを表示する': 'Display a link to each article';
691  function checkNavLinkStyle() {
692    $('.js-sticky .c-nav-link, .js-sticky > .p-block__inner > .c-nav-link-anchor, .js-sticky > .p-block__inner > .c-nav-link-anchor-outer').each(function(){
693      if(window.matchMedia('(max-width: 1249px)').matches && currentWidth >= 1250){
694        $(this).closest('.p-block__inner').addClass('c-btn-accordion')
695        $(this).before(`<button class="js-sticky-current-nav" title="${navAccessibilityText}" aria-controls="anchor-links" aria-expanded="false">` + $(this).find('li:first-child > a').text() + `<span class="u-visually-hidden">${navAccessibilityText}</span>` + '</button>');
696        $(this).css({'display': 'none'});
697      }else if(window.matchMedia('(min-width: 1250px)').matches && currentWidth < 1250){
698        $(this).closest('.p-block__inner').removeClass('c-btn-accordion');
699        $(this).closest('.p-block__inner').removeClass('is-open');
700        $(this).prev().remove();
701        $(this).css({'display': ''});
702      }
703    });
704  }
705  if($('.js-sticky .c-nav-link, .js-sticky > .p-block__inner > .c-nav-link-anchor, .js-sticky > .p-block__inner > .c-nav-link-anchor-outer').length){
706    if(window.matchMedia('(max-width: 1249px)').matches){
707      $('.js-sticky .c-nav-link, .js-sticky > .p-block__inner > .c-nav-link-anchor').each(function(){
708        $(this).closest('.p-block__inner').addClass('c-btn-accordion')
709        $(this).before(`<button class="js-sticky-current-nav" title="${navAccessibilityText}" aria-controls="anchor-links" aria-expanded="false">` + $(this).find('li:first-child > a').text() + `<span class="u-visually-hidden">${navAccessibilityText}</span>` + '</button>');
710        $(this).css({'display': 'none'});
711      });
712      $('.js-sticky > .p-block__inner > .c-nav-link-anchor-outer').each(function(){
713        $(this).closest('.p-block__inner').addClass('c-btn-accordion')
714        $(this).before(`<button class="js-sticky-current-nav" title="${navAccessibilityText}">` + $(this).find('.c-nav-link-anchor li:first-child >
714 a').text() + `<span class="u-visually-hidden">${navAccessibilityText}</span>` + '</button>');
715      });
716    }
717    currentWidth = window.innerWidth;
718  }
719  $(document).on('click', '.js-sticky > .p-block__inner .c-nav-link-anchor a', function(){
720    if(window.matchMedia('(max-width: 1249px)').matches){
721      $(this).closest('.js-sticky').find('.js-sticky-current-nav').text($(this).text()).trigger('click');
722    }
723  });
724  $(window).on('resize', function(){
725    if($('.js-sticky .c-nav-link, .js-sticky > .p-block__inner > .c-nav-link-anchor, .js-sticky > .p-block__inner > .c-nav-link-anchor-outer').length){
726      checkNavLinkStyle();
727      currentWidth = window.innerWidth;
728    }
729  });
730});
731
732/*---------------------------------
733// フォーム用
734---------------------------------*/
735$(function(){
736  let name;
737  if($('.js-form-radio-trigger').length){
738    name = $('.js-form-radio-trigger').attr('name');
739    $('.js-form-radio-trigger').each(function(){
740      if($(this).prop('checked')){
741        var index = $(this).closest('ul').find('.js-form-radio-trigger').index(this);
742        $(this).closest('ul').nextAll('.js-form-radio-toggle').eq(index).addClass('is-active');
743      }
744    });
745  }
746  $(document).on('change', 'input[type="radio"][name=' + name + ']', function(){
747    if($(this).hasClass('js-form-radio-trigger') && $(this).prop('checked')){
748      $('.js-form-radio-toggle').removeClass('is-active');
749      var index = $(this).closest('ul').find('.js-form-radio-trigger').index(this);
750      $(this).closest('ul').nextAll('.js-form-radio-toggle').eq(index).addClass('is-active');
751    }else{
752      $('.js-form-radio-toggle').removeClass('is-active');
753    }
754  });
755});
756
757/*---------------------------------
758// スクロール時の処理
759---------------------------------*/
760$(function(){
761  // ヘッダ処理
762  var currentPos = 0;
763  function checkHeaderScroll() {
764    if($(window).scrollTop() >= currentPos && $(window).scrollTop() != 0){
765      $('.l-header').addClass('is-scroll');
766      $('.l-header-ed23').addClass('is-scroll');
767    }else if($(window).scrollTop() < currentPos || $(window).scrollTop() == 0){
768      $('.l-header').removeClass('is-scroll');
769      $('.l-header-ed23').removeClass('is-scroll');
770    }
771    if($(window).scrollTop() > 0){
772      $('.l-header').addClass('is-bg');
773      $('.l-header-ed23').addClass('is-bg');
774    }else{
775      $('.l-header').removeClass('is-bg');
776      $('.l-header-ed23').removeClass('is-bg');
777    }
778  }
779
780  // stickyナビゲーション処理
781  var $this;
782  var $thisDummyHeight;
783  var $thisPos;
784  var $thisPosMargin;
785  function checkStickyScroll() {
786    if($(window).scrollTop() + $thisPosMargin > $thisPos && $(window).scrollTop() >= currentPos){
787      $this.addClass('is-scroll');
788      $this.removeClass('is-scroll-minus');
789      if(window.matchMedia('(min-width: 1250px)').matches){
790        $thisPosMargin = 80;
791        $thisDummyHeight = $this.outerHeight() + 54;
792      }else{
793        $thisPosMargin = 70;
794        $thisDummyHeight = $this.find('.js-sticky-current-nav').outerHeight() + 2;
795      }
796      if(!$('.js-sticky-dummy').length){
797        $this.before('<div class="js-sticky-dummy" style="height: ' + $thisDummyHeight + 'px">' + $(this).find('li:first-child > a').text() + '</div>');
798      }
799    }else if($(window).scrollTop() + $thisPosMargin > $thisPos && $(window).scrollTop() < currentPos){
800      $this.addClass('is-scroll');
801      if(window.matchMedia('(min-width: 1250px)').matches){
802        $thisPosMargin = 80;
803      }else{
804        $thisPosMargin = 70;
805      }
806    }else{
807      $this.removeClass('is-scroll');
808      $this.removeClass('is-scroll-minus');
809      $('.js-sticky-dummy').remove();
810      if(window.matchMedia('(min-width: 1250px)').matches){
811        $thisPosMargin = 80;
812      }else{
813        $thisPosMargin = 70;
814      }
815    }
816  }
817
818  if($(window).scrollTop() != 0){
819    currentPos = $(window).scrollTop();
820  }
821  checkHeaderScroll();
822  if($('.js-sticky').length){
823    var startPos = 0, winScrollTop = 0;
824    $this = $('.js-sticky');
825    $thisPos = $this.offset().top;
826    $(window).on('scroll', function () {
827      winScrollTop = $(this).scrollTop();
828      if (winScrollTop >= startPos) {
829        $('.l-header').addClass('is-scroll');
830        $('.l-header-ed23').addClass('is-scroll');
831      } 
832      if (winScrollTop >= $thisPos) {
833        $('.l-header').addClass('u-pos-absolute');
834        $('.l-header-ed23').addClass('u-pos-absolute');
835        $('.js-sticky').addClass('u-top-0');
836      } else {
837        $('.l-header').removeClass('u-pos-absolute');
838        $('.l-header-ed23').removeClass('u-pos-absolute');
839        $('.js-sticky').removeClass('u-top-0');
840      }
841      if ($('.js-sticky').hasClass('is-scroll-minus')) {
842        $('.l-header-ed23').removeClass('u-pos-absolute');
843        $('.js-sticky').removeClass('u-top-0');
844      }
845      startPos = winScrollTop;
846    });
847    if(window.matchMedia('(min-width: 1250px)').matches){
848      $thisPosMargin = 80;
849    }else{
850      $thisPosMargin = 70;
851    }
852    checkStickyScroll();
853  }
854  currentPos = $(window).scrollTop();
855
856  $(window).on('scroll', function(){
857    checkHeaderScroll();
858    if($('.js-sticky').length){
859      checkStickyScroll();
860    }
861    currentPos = $(window).scrollTop();
862  });
863
864  $(window).on('resize', function(){
865    if($('.js-sticky').length){
866      checkStickyScroll();
867    }
868    currentPos = $(window).scrollTop();
869  });
870});
871// stickyナビゲーション文字色処理
872$(function () {
873  $(".c-nav-link-anchor > li > a").on("click", function (event) {
874    event.preventDefault();
875    $(".c-nav-link-anchor > li > a").not(this).removeClass("selected");
876    $(this).addClass("selected").siblings().removeClass("selected");
877  });
878});
879
880$(function () {
881  const navAccessibilityText = $('.l-header-ed23').hasClass('is-jp') ? '各記事へのリンクを表示する': 'Display a link to each article';
882  
883  $(window).scroll(function() {
884    var scrollPosition = $(this).scrollTop();
885    var stickyText = $(".js-sticky-current-nav");
886    $(".c-nav-link-anchor > li > a").each(function() {
887      var targetId = $(this).attr("href");
888      var targetPosition = $(targetId).offset().top;
889      var targetHeight = $(targetId).outerHeight();
890
891      if (scrollPosition >= targetPosition - 240 && scrollPosition < targetPosition + targetHeight) {
892        $(this).addClass("selected").parent().siblings().find("a").removeClass("selected");
893        stickyText.html(
894          $(this).text() +
895            `<span class="u-visually-hidden">${navAccessibilityText}</span>`
896        );
897      } else {
898        $(this).removeClass("selected");
899      }
900    });
901  });
902});
903
904/*---------------------------------
905// アンカーリンクのスムーズスクロール
906---------------------------------*/
907$(function(){
908  $(document).on('click', 'a[href^="#"]:not([href^="#modal"]):not([href^="#case"])', function(){
909    if($(this).attr('onclick') && $(this).attr('onclick').indexOf('openM
909odal') != -1){
910      return false;
911    }else if($(this).attr('onclick') && ($(this).text().indexOf('cookie') != -1 || $(this).text().indexOf('クッキー') != -1)){
912      return false;
913    }else if($(this).attr('onclick') && $(this).attr('onclick').indexOf('selectorOpen') != -1){
914      return false;
915    }else if($(this).closest('#countryInitialModalDialog').length){
916      return false;
917    }else if($(this).closest('.c-pagenation').length){
918      return false;
919    }else if($(this).closest('.p-search').length){
920      return false;
921    }else if($(this).closest('.p-careers-keyword').length){
922      return false;
923    }else if($(this).closest('.p-search__search-form__select').length){
924      return false;
925    }
926    var speed = 500;
927    var href = $(this).attr('href');
928    var target = $(href == '#' || href == '' ? 'html' : href);
929    var headerHeight;
930    var position;
931    var jsStickeyHeight = 0;
932    if(target.offset().top > $(window).scrollTop()){
933      if(window.matchMedia('(max-width: 1249px)').matches){
934        headerHeight = 70;
935      }else{
936        headerHeight = 80;
937      }
938    }else{
939      if(window.matchMedia('(max-width: 1249px)').matches){
940        headerHeight = 70;
941      }else{
942        headerHeight = 160;
943      }
944    }
945    if($(this).closest('.js-sticky').length){
946      if(window.matchMedia('(max-width: 1249px)').matches){
947        if($(this).closest('.js-sticky').css('position') == 'relative'){
948          jsStickeyHeight = Math.round($(this).closest('.js-sticky').find('.js-sticky-current-nav').outerHeight()) + Math.round($(this).closest('.js-sticky').find('.c-btn-accordion > *:last-child').outerHeight());
949        }else if($(this).closest('.js-sticky').css('position') == 'fixed'){
950          jsStickeyHeight = Math.round($(this).closest('.js-sticky').find('.js-sticky-current-nav').outerHeight()) + 2;
951        }
952      }else{
953        if($(this).closest('.js-sticky').css('position') == 'relative'){
954          jsStickeyHeight = ($(this).closest('.js-sticky').outerHeight()) - 54;
955        }else if($(this).closest('.js-sticky').css('position') == 'fixed'){
956          jsStickeyHeight = ($(this).closest('.js-sticky').outerHeight());
957        }
958      }
959    }
960    if(target.offset().top == 0){
961      position = Math.round(target.offset().top);
962    }else if(target.offset().top > 0 && !$('.js-sticky').length){
963      position = Math.round(target.offset().top) - headerHeight;
964    }else if(target.offset().top > 0 && $('.js-sticky').length){
965      position = Math.round(target.offset().top) - headerHeight - jsStickeyHeight;
966    }
967    $('html, body').animate({
968      scrollTop: position
969    }, speed, 'swing', function(){
970      target.attr('tabindex', '-1');
971      target.focus();
972    });
973
974    return false;
975  });
976});
977
978/*---------------------------------
979// トップへ戻るボタンのスムーズスクロール
980---------------------------------*/
981$(function(){
982  var target = '';
983  if($('.l-header-ed23').length > 0){
984    target = $('.l-header-ed23__logo');
985  } else {
986    target = $('.l-header__logo');
987  }
988  $(document).on('click', '.js-page-top-button', function(){
989    var speed = 500;
990    $('body,html').animate({ scrollTop: 0 }, speed, 'swing', function(){
991      target.attr('tabindex', '-1');
992      target.focus();
993    });
994
995    return false;
996  });
997});
998
999/*---------------------------------
1000// フィルター制御
1001---------------------------------*/
1002// フィルターエリアの開閉
1003$(document).on('click', '.js-filter li > button', function(){
1004  const $this = $(this);
1005  const $button = $this.closest('.js-filter').find('li > button');
1006  const filter = $this.attr('data-filter');
1007
1008  if ($this.hasClass('js-filter-all-button')) {
1009    // 押下したボタンが全てを見るボタンの場合
1010    $('.p-block-filter-select').removeClass('is-open');
1011    $button.removeClass('is-open');
1012    $button.not('.js-filter-all-button').attr('aria-expanded','false');
1013    if (window.matchMedia('(min-width: 768px)').matches) {
1014      $this.closest('.js-filter').css({
1015        'margin-bottom': ''
1016      });
1017    }
1018  } else if ($this.hasClass('is-open') === false && $button.not($this).hasClass('is-open') === true) {
1019    // 押下したボタンのアコーディオンが開いておらず、他のアコーディオンが開いている場合
1020    $('.p-block-filter-select').removeClass('is-open')
1021    $('.p-block-filter-select[data-filter="' + filter + '"]').addClass('is-open');
1022    $button.removeClass('is-open');
1023    $this.addClass('is-open');
1024    $button.not('.js-filter-all-button').attr('aria-expanded','false');
1025    $this.attr('aria-expanded','true');
1026    if (window.matchMedia('(min-width: 768px)').matches) {
1027      $this.closest('.js-filter').css({
1028        'margin-bottom': $this.next().outerHeight()
1029      });
1030    }
1031  } else if ($this.hasClass('is-open') === true) {
1032    // 押下したボタンのアコーディオンが開いている場合
1033    $('.p-block-filter-select[data-filter="' + filter + '"]').removeClass('is-open');
1034    $this.removeClass('is-open');
1035    $this.attr('aria-expanded','false');
1036    if (window.matchMedia('(min-width: 768px)').matches) {
1037      $this.closest('.js-filter').css({
1038        'margin-bottom': ''
1039      });
1040    }
1041  } else {
1042    // ボタンを押下した時、全てのアコーディオンが閉じている場合
1043    $('.p-block-filter-select[data-filter="' + filter + '"]').addClass('is-open');
1044    $this.addClass('is-open');
1045    $this.not('.js-filter-all-button').attr('aria-expanded','true');
1046    if (window.matchMedia('(min-width: 768px)').matches) {
1047      $this.closest('.js-filter').css({
1048        'margin-bottom': $this.next().outerHeight()
1049      });
1050    }
1051  }
1052});
1053
1054/*---------------------------------
1055// イベントタグ
1056---------------------------------*/
1057$(function(){
1058  var now = new Date();
1059  var count = 0;
1060  $('.c-tag[data-start]').each(function(){
1061    var dataEndArrey = $(this).attr('data-end').split('-');
1062    var end = new Date(dataEndArrey[0], dataEndArrey[1] - 1, dataEndArrey[2], dataEndArrey[3], dataEndArrey[4]);
1063    if(end < now){
1064      $(this).addClass('is-end').text('終了');
1065    }else{
1066      if($(this).attr('data-start') == ''){
1067        $(this).addClass('is-before').text('開催');
1068      }else{
1069        var dataStartArrey = $(this).attr('data-start').split('-');
1070        var start = new Date(dataStartArrey[0], dataStartArrey[1] - 1, dataStartArrey[2], dataStartArrey[3], dataStartArrey[4]);
1071        if(start < now){
1072          $(this).addClass('is-before').text('受付中');
1073        }else{
1074          $(this).addClass('is-accepting').text('開催');
1075        }
1076      }
1077    }
1078  });
1079});
1080
1081// トップMVのカルーセル用(Swiper)---------------------------------------------
1082const swiperClass = $('div').hasClass('swiper');
1083
1084if (swiperClass) {
1085  const thumbClass = 'swiper-thumb-progressbar';
1086  const mytap = window.ontouchstart === null?"touchstart":"click";
1087
1088  const swiper2 = new Swiper(".swiper-thumb-progressbar", {
1089    slidesPerView: 'auto',
1090    spaceBetween: 10,
1091    autoplay: {
1092      delay: 5000,
1093      disableOnInteraction: false,
1094    },
1095  });
1096  // サムネイルの形でプログレスバーを追加(表記はscrollber)
1097  const swiper = new Swiper(".swiper", {
1098    slidesPerView: '1',
1099    autoplay: {
1100      delay: 5000,
1101      disableOnInteraction: false,
1102    },
1103    loop: true,
1104    thumbs: {
1105      swiper: swiper2
1106    },
1107    scrollbar: {
1108      el: ".swiper-thumb-progressbar .swiper-wrapper",
1109      clickable: true,
1110      type:'custom',
1111    },
1112    navigation: {
1113      nextEl: '.swiper-button-next',
1114      prevEl: '.swiper-button-prev',
1115    },
1116    pagination: {
1117      el: '.swiper-pagination',
1118      clickable: true,
1119      type: 'bullets'
1120    },
1121    a11y: {
1122      prevSlideMessage: '',
1123      nextSlideMessage: '',
1124    },
1125  });
1126
1127  // サムネイルカスタム用
1128  const clickThumb_progressbar = (()=>{
1129    const thumbItems = document.getElementsByClassName(thumbClass);
1130    for(let i = 0; i < thumbItems.length ; i ++){
1131      thumbItems[i].addEventListener(mytap,((e)=>{
1132        let index = e.currentTarget.dataset.slideto;
1133        swiper.slideTo(index, 500, true);
1134      }),false);
1135    }
1136  });
1137
1138  clickThumb_progressbar();
1139  swiper.on('slideChange',clickThumb_progressbar);
1140  // 疑似要素に干渉できないのでスタイルルールの追加
1141  var sheets = document.styleSheets
1142  var sheet = sheets[sheets.length - 1];
1143  $('.swiper-button-switch').on('click', function () {
1144    $(this).toggleClass('is-swiper');
1145    if ($(this).hasClass('is-swiper')) {
1146      swiper.autoplay.start();
1147      swiper2.autoplay.start();
1148      sheet.insertRule(
1149        '.swiper-slide-thumb-active .progressbar::before { animation-play-state: running; animation: none;} ', //一回アニメを削除してから
1150        sheet.cssRules.length
1151      );
1152      setTimeout (function () { //ディレイを入れてアニメcss変更で、リセット対応
1153        sheet.insertRule(
1154          '.swiper-slide-thumb-active .progressbar::before { animation: sliderPagination 5s linear forwards;} ',
1155          sheet.cssRules.length
1156          );
1157          },10);
1158    } else {
1159      swiper.autoplay.stop();
1160      swiper2.autoplay.stop();
1161      sheet.insertRule(
1162        '.swiper-slide-thumb-active .progressbar::before { animation-play-state: paused; }',
1163        sheet.cssRules.length
1164      );
1165    }
1166  });
1167  // レスポンシブ対応
1168  const mediaQueryList = window.matchMedia('(min-width: 768px)');
1169  const listener = (event) => {
1170    if (event.matches) {
1171      if ($('.swiper-button-switch').hasClass('is-swiper')) {
1172          swiper.autoplay.start();
1173        } else {
1174          swiper.autoplay.stop();
1175        }
1176    } else {
1177      swiper.autoplay.stop();
1178    }
1179  };
1180
1181  mediaQueryList.addEventListener("change", listener);
1182  listener(mediaQueryList);
1183}
1184// Swiperここまで---------------------------------------------
1185// ラインナップのSwiper----------------------------------------
1186const lineupswiperClass = $('div').hasClass('lineup_swiper');
1187
1188if (lineupswiperClass) {
1189  const mySwiper = new Swiper('.lineup_swiper', {
1190    loop: true,
1191    slidesPerView: 1,
1192    effect: 'fade',
1193    speed: 600,
1194    autoplay: {
1195      delay: 3500,
1196      disableOnInteraction: false,
1197    },
1198    navigation: {
1199      nextEl: '.lineup_swiper-button-next',
1200      prevEl: '.lineup_swiper-button-prev',
1201    },
1202
1203  });
1204}
1205// ラインナップのSwiperここまで----------------------------------
1206/*---------------------------------*/
1207})(jQuery);
1208
1209
1210
1211/*---------------------------------
1212// ページロード後の処理
1213---------------------------------*/
1214$(window).on('load', function() {
1215  // 別ページからのアンカーリンク遷移処理
1216  var headerHeight;
1217  if(window.matchMedia('(max-width: 1249px)').matches){
1218    headerHeight = 70;
1219  }else{
1220    headerHeight = 80;
1221  }
1222  var stickyHeight = headerHeight;
1223  if($('.js-sticky.is-scroll').length){
1224    stickyHeight = headerHeight + $('.js-sticky.is-scroll').outerHeight();
1225  }
1226  var url = $(location).attr('href');
1227  if(url.indexOf("#") != -1){
1228    var anchor = url.split('?');
1229    anchor = anchor[0].split('#');
1230    var target = $('#' + anchor[anchor.length - 1]);
1231    var position = Math.floor(target.offset().top) - stickyHeight;
1232    $('html, body').animate({scrollTop:position-100}, 0);
1233    setTimeout(function(){
1234    $('html, body').animate({scrollTop:position}, 0);
1235    }, 0);
1236  }
1237});
1238

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.