PageSourceSearch

https://kominka-neri.com/wp-content/themes/kominkaneri/js/scroll_header.js

js kominka-neri.com collected 2026-10-06 15:17:11 UTC 1,248 bytes, 33 lines download raw bytes

1// Google Hosted LibrariesからjQuery取得 -->
2
3//<!-- ▲ローカルに保存したjQuery本体へのリンクでももちろんOK -->
4
5//<!--for Scroll fix header -->
6$(function () {
7	"use strict";
8	var flag = "view";
9
10  $(window).on("scroll", function () {
11    // scrollTop()が「200」より大きい場合
12   //画面トップから、ナビゲーションメニューまでの高さ(ピクセル)を指定すれば、メニュースクロールで
13   //消えていくタイミングでヘッダが表示されて固定される。  
14    
15    if ($(this).scrollTop() > 200) {
16      if (flag === "view") {
17        $(".scroll").stop().css({opacity: '1.0'}).animate({
18   //”▲.fix-header”の部分は固定ヘッダとして表示させるブロックのID名もしくはクラス名に
19          top: 0
20        }, 500);
21
22        flag = "hide";
23      }
24    } else {
25      if (flag === "hide") {
26        $(".scroll").stop().animate({top:"-66px",opacity: 0}, 500);
27		//上にあがり切ったら透過度を0%にして背景が生きるように
28            //”▲.fix-header”の部分は固定ヘッダとして表示させるブロックのID名もしくはクラス名に
29        flag = "view";
30      }
31    }
32  });
33});

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.