PageSourceSearch

https://www.maruhachi.co.jp/wp-content/themes/maruhachi/js/scroll.js

js maruhachi.co.jp collected 2026-10-05 07:09:29 UTC 871 bytes, 23 lines download raw bytes

1// スクロール操作したとき
2$(window).on('scroll', function () {
3
4  // クラス名【 inview 】が付与されている、全ての要素に対して処理を実行
5  $('.inview').each(function() {
6
7    // ブラウザの最上部から、クラス名【 inview 】が付与されている要素の位置を取得
8    var targetPosition = $(this).offset().top;
9
10    // ブラウザの最上部からのスクロール量を取得
11    var scroll = $(window).scrollTop();
12
13    // ウィンドウの高さを取得
14    var windowHeight = $(window).height();
15
16    // ブラウザの最上部からのスクロール量 > クラス名【 inview 】が付与されている要素の位置 - ウィンドウの高さを取得
17    if (scroll > targetPosition - windowHeight) {
18
19      // クラス名【 show 】を付与
20      $(this).addClass('show');
21    }
22  });
23});

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.