PageSourceSearch

https://susabiyu-initiate.jp/assets/js/common.js

js susabiyu-initiate.jp collected 2026-10-08 00:19:38 UTC 2,963 bytes, 103 lines download raw bytes

1$(document).ready(function () {
2  // matchHeight
3  $('.page_tab li span, .col3_overlap_block_txt h4, .brand-info-inner').matchHeight();
4
5  // ハンバーガーメニュー
6  $('.toggle').click(function () {
7    $(this).toggleClass('open').parent().siblings().toggleClass('active');
8    $('body').toggleClass('hidden');
9  });
10
11  $('.gnav a').click(function () {
12    $('.toggle').removeClass('open');
13    $('nav').removeClass('active');
14    $('body').removeClass('hidden');
15  });
16
17  // スクロールイベント
18  let scrollHeight, scrollPosition, footHeight;
19  $(window).on("scroll", function () {
20    const $pagetop = $('.pagetop');
21    const scrollTop = $(window).scrollTop();
22
23    // ページトップボタンの位置制御
24    scrollHeight = $(document).height();
25    scrollPosition = $(window).height() + scrollTop;
26    footHeight = $("footer").innerHeight();
27
28    if (scrollHeight - scrollPosition <= footHeight) {
29      $pagetop.css({
30        "position": "absolute",
31        "bottom": footHeight,
32        "opacity": "1"
33      });
34    } else {
35      $pagetop.css({
36        "position": "fixed",
37        "bottom": "20px",
38        "opacity": "0.8"
39      });
40    }
41
42    // フェード表示
43    $('.js-fade-content').each(function () {
44      const targetPosition = $(this).offset().top;
45      const windowHeight = $(window).height();
46      $(this).toggleClass('is-show', scrollTop > targetPosition - windowHeight);
47    });
48
49    // ヘッダーのスクロール効果
50    $("header").toggleClass('scrollon', scrollTop > 60);
51  });
52
53  // ページトップボタンクリック
54  $('.pagetop').click(function () {
55    $('body,html').animate({ scrollTop: 0 }, 'slow');
56    return false;
57  });
58});
59
60// ローディング処理
61$(window).on('load', function () {
62  const stopload = () => {
63    $('.wrapper').css('display', 'block').fadeIn();
64    $('.loading').delay(100).fadeOut(800);
65  };
66
67  stopload();
68  setTimeout(stopload, 10000); // フォールバック
69
70  // アンカーリンク処理
71  const headerHeight = 70;
72
73  // ページ内リンク
74  $('a[href^="#"]').on("click", function (e) {
75    e.preventDefault();
76    const href = $(this).attr("href");
77    const target = $(href === "#" || href === "" ? "html" : href);
78
79    if (target.length) {
80      const position = target.offset().top;
81      const adjustedPosition = $(window).width() <= 1025 ? position - headerHeight : position;
82      $("html, body").animate({ scrollTop: adjustedPosition }, 1000, "swing");
83    }
84  });
85
86  // ページ外からのアンカーリンク
87  const url = location.href;
88  const idIndex = url.indexOf("?id=");
89  if (idIndex !== -1) {
90    const hash = "#" + url.split("?id=")[1];
91    const target = $(hash);
92    if (target.length) {
93      $("html, body").animate({
94        scrollTop: target.offset().top - headerHeight
95      }, 1000, "swing");
96    }
97  }
98});
99
100// リサイズ時の初期化
101$(window).on('load resize', function () {
102  $('body').removeClass('hidden');
103});

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.