PageSourceSearch

https://blog.ocnk.net/blog/wp-content/themes/gold-media/js/header-clone.js?ver=1.0.3

js ocnk.net collected 2026-09-24 08:32:42 UTC 1,099 bytes, 30 lines download raw bytes

1// ------------------------------------------
2// クローンヘッダー(追従用)
3// ------------------------------------------
4
5( function ( $ ) {
6	const $win   = $( window );
7	let position = 0;
8
9	$win.on( 'scroll', function () {
10		// overflow: hidden のときは処理スキップ
11		if ( 'hidden' === $( 'body' ).css( 'overflow' ) ) {
12			return;
13		}
14
15		const headerClone  = $( '.l-header_clone' );        // クローンヘッダーのclass名
16		const showClass    = 'is-show';                     // トグルさせるclass名
17		const headerHeight = headerClone.outerHeight() * 2; // クローンヘッダーの高さ×2
18		const scrollPos    = $( this ).scrollTop();         // 上へスクロールした時の位置
19
20		// 上にスクロールした時 & 上へスクロールした時の位置がクローンヘッダーの高さ×2より大きい場合
21		if ( scrollPos < position && scrollPos > headerHeight ) {
22			// class追加
23			headerClone.addClass( showClass );
24		} else {
25			// class削除
26			headerClone.removeClass( showClass );
27		}
28		position = scrollPos;
29	} );
30} )( jQuery );

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.