PageSourceSearch

http://www.kyobunkwan.co.jp/themes/kyobunkwan@site/js/header-nav.js?date=20260827103632

js kyobunkwan.co.jp collected 2026-09-24 09:02:08 UTC 2,946 bytes, 92 lines download raw bytes

1{
2  $(function () {
3
4    const $header = $("header");
5    const $footer = $("footer");
6    const $pagetop = $("#pagetop");
7    const $nab_mobaile = $(".global-nav-mobile-menu");
8    
9  
10    const hideClass = "is-hidden";
11    let isHidden = false;
12  
13    $(window).on("scroll", function () {
14  
15      const scrollTop = $(window).scrollTop(); 
16      const footerTop = $footer.offset().top; 
17      const headerHeight = $header.outerHeight(); 
18  
19      if (scrollTop + headerHeight >= footerTop) {
20        if (!isHidden) {
21          $header.addClass(hideClass);
22          $nab_mobaile.addClass(hideClass);
23          isHidden = true;
24        }
25      } else {
26        if (isHidden) {
27          $header.removeClass(hideClass);
28          $nab_mobaile.removeClass(hideClass);
29          isHidden = false;
30        }
31      }
32    });
33  
34    $pagetop.on("click", function (e) {
35      e.preventDefault();
36  
37      $("html, body").animate({ scrollTop: 0 }, 500, function () {
38        $header.removeClass(hideClass);
39        $nab_mobaile.removeClass(hideClass);
40        isHidden = false;
41      });
42    });
43  
44  });
45  
46  document.querySelectorAll('.global-nav-item.no-pointer > a').forEach((a) => {
47      a.addEventListener('click', (e) => {
48          e.preventDefault();
49      });
50  });
51  
52  // ハンバーガーメニュー開閉時のスクロール制御
53  const mobileNav = document.getElementById('global-nav-mobile');
54  
55  const mobileNavObserver = new MutationObserver(() => {
56      if (window.innerWidth <= 1099) {
57          if (mobileNav.classList.contains('is-active')) {
58              document.body.classList.add('is-locked');
59  
60              // 各liを順番に表示
61              const items = mobileNav.querySelectorAll('.global-nav-mobile-item.level-1');
62              const spHidden = mobileNav.querySelector('.header-item-nav-right-fixed.sp-hidden');
63  
64              items.forEach((item, index) => {
65                  item.classList.remove('is-visible');
66                  setTimeout(() => {
67                      item.classList.add('is-visible');
68                  }, index * 80);
69              });
70  
71              // sp-hiddenをliの最後の後に表示
72              if (spHidden) {
73                  spHidden.classList.remove('is-visible');
74                  setTimeout(() => {
75                      spHidden.classList.add('is-visible');
76                  }, items.length * 80);
77              }
78  
79          } else {
80              document.body.classList.remove('is-locked');
81  
82              const items = mobileNav.querySelectorAll('.global-nav-mobile-item.level-1');
83              const spHidden = mobileNav.querySelector('.header-item-nav-right-fixed.sp-hidden');
84  
85              items.forEach(item => item.classList.remove('is-visible'));
86              if (spHidden) spHidden.classList.remove('is-visible');
87          }
88      }
89  });
90  
91  mobileNavObserver.observe(mobileNav, { attributes: true, attributeFilter: ['class'] });
92}

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.