PageSourceSearch

https://hakusan-mfg.co.jp/wp-content/themes/hakusan2023/common/js/lib.js?ver=20261005110624

js hakusan-mfg.co.jp collected 2026-10-05 11:06:56 UTC 6,614 bytes, 208 lines download raw bytes

1//================================
2//  ! 検索窓
3//================================
4$(function(){
5    $('.l-gnav-btn .search').on('click', function () {
6        $('.l-gnav-btn .search').toggleClass('on')
7        $('.inner-menu-buttons .search').slideToggle();
8
9        // メニューを閉じる
10        $('.l-gnav-btn .hamburger, .js-gnav').removeClass('f-js-open');
11    });
12});
13
14
15//================================
16//  ! ハンバーガー
17//================================
18$(window).on("load", function() {
19    // var w = $(window).width();
20    // var x = 1024;
21    // if (w <= x) { //1024px以下
22});
23
24$(function(){
25	console.debug('hamburger_start');
26	$('.l-gnav-btn .hamburger').click(function(){
27        $('.l-gnav-btn .hamburger, .js-gnav').toggleClass('f-js-open');
28        
29        // 検索窓を閉じる
30        $('.l-gnav-btn .search').removeClass('on')
31        $('.inner-menu-buttons .search').css('display', '');
32	});
33	console.debug('hamburger_end');
34    //});
35    // } else { //1024px以上
36	// console.debug('pcview');
37    // }
38});
39
40
41//================================
42//  ! アコーディオン
43//================================
44$(function () {
45    $('.c-l-d-inner').on('click', function () {
46    $(this).next().slideToggle();
47    //openクラスをつける
48    $(this).toggleClass("open");
49    //クリックされていない__menuのopenクラスを取る
50    $('.c-l-d-inner').not(this).removeClass('open');
51    // 一つ開くと他は閉じるように
52    $('.c-l-d-inner').not($(this)).next('.c-l-d-inner-list').slideUp();
53  });
54});
55
56
57
58//================================
59//  ! パンくず 省略
60//================================
61$(function () {
62    const limit = document.querySelector(".breadcrumb_last");
63    const str = limit;
64    const len = 30; // 半角30字(全角約25字)
65    if (str > len) {
66      limit = str.substring(0, len) + "…";
67    }
68});
69
70
71
72//================================
73//  ! header スクロールしたらクラスがつく
74//================================
75$(function() {
76    $(window).on('load scroll', function() {
77        if ( window.document.body.id === 'top' ) { // bodyのidがtopの時だけ
78            var scrollPos = $(this).scrollTop(); // スクロール量取得
79            var classHeight = $('.__fv').get(0).scrollHeight; // 指定要素の高さ取得
80            if ( scrollPos > classHeight ) { // スクロール量>指定要素の高さ=class付け外し
81                $('.js-header').addClass('scroll-header');
82            } else {
83                $('.js-header').removeClass('scroll-header');
84            }
85        }
86    });
87});
88
89
90
91//================================
92//  ! aboutus スクロールしたらクラスがつく
93//================================
94$(function() {
95    $(window).on('load scroll', function() {
96        if ( window.document.body.id === 'about' ) { // bodyのidがtopの時だけ
97            var scrollPos = $(this).scrollTop(); // スクロール量取得
98            var classHeight = $('.body-sdgs').get(0).scrollHeight; // 指定要素の高さ取得
99            if ( scrollPos > classHeight ) { // スクロール量>指定要素の高さ=class付け外し
100                $('.js-bg').addClass('scroll-bg');
101            } else {
102                $('.js-bg').removeClass('scroll-bg');
103            }
104        }
105    });
106});
107
108
109
110//================================
111//  ! footer スクロールしたらクラスがつく
112//================================
113$(function() {
114    $(window).on('load scroll', function() {
115        if ( window.document.body.id === 'top' ) { // bodyのidがtopの時だけ
116            var scrollPos = $(this).scrollTop(); // スクロール量取得
117            var classHeight = $('.js-fo-footer').get(0).scrollHeight; // 指定要素の高さ取得
118            if ( scrollPos > classHeight ) { // スクロール量>指定要素の高さ=class付け外し
119                $('.js-banner-ad').addClass('scroll-footer');
120            } else {
121                $('.js-banner-ad').removeClass('scroll-footer');
122            }
123        }
124    });
125});
126
127
128
129//================================
130//  ! クリップボードへのコピー
131//================================
132$(function () {
133    $('.copy-url-js').click(function () {
134        // data-urlの値を取得
135        const url = $(this).data('url');
136
137        // クリップボードにコピー
138        navigator.clipboard.writeText(url);
139
140        // フラッシュメッセージ表示
141        $('.success-msg').fadeIn("slow", function () {
142            $(this).delay(2000).fadeOut("slow");
143        });
144    });
145});
146
147//================================
148//  ! infiniteslide スクロール
149//================================
150$(function(){
151    $('.infiniteslide').infiniteslide({
152    speed: 40,
153    direction: 'left',
154    pauseonhover: false,
155    clone: 2,
156    });
157});
158
159
160
161//================================
162//  ! スマホ アドレスバーの高さを取得
163//================================
164$(function() {
165    $('.sp-100vh').css('height',$(window).height());
166});
167
168
169//================================
170//  ! スムーススクロール
171//================================
172// ページ内のスムーススクロール
173$(function () {
174    $(document).on('click', 'a[href*="#"]', function(e) {
175        const target = $(this.hash === "" ? "html" : this.hash);
176        if (target.length) {
177            e.preventDefault();
178            const headerHeight = $("header").outerHeight();
179            const position = target.offset().top - headerHeight;
180            $("html, body").animate({ scrollTop: position }, 500, "swing");
181
182            if (!target.is("html")) {
183                // URLにハッシュを含める
184                history.pushState(null, '', this.hash);
185            }
186        }
187    });
188
189    // 別ページ遷移後のスムーススクロール
190    const urlHash = location.hash;
191    if (urlHash) {
192        const target = $(urlHash);
193        if (target.length) {
194            // ページトップから開始(ブラウザ差異を考慮して併用)
195            history.replaceState(null, '', window.location.pathname);
196            $("html,body").stop().scrollTop(0);
197
198            $(window).on("load", function () {
199                const headerHeight = $("header").outerHeight();
200                const position = target.offset().top - headerHeight;
201                $("html, body").animate({ scrollTop: position }, 500, "swing");
202
203                // ハッシュを再設定
204                history.replaceState(null, '', window.location.pathname + urlHash);
205            });
206        }
207    }
208});

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.