PageSourceSearch

https://www.iwate373.com/js/common.js

js iwate373.com collected 2026-10-09 04:08:55 UTC 903 bytes, 22 lines download raw bytes

1$(function() {
2 
3  // ①aタグをクリックし、href属性に # から始まるリンクが設定してあったら発動
4  $('a[href^="#"]').click(function(){
5 
6    // ②クリックしたaタグのhref属性(リンク先URI)を取得し、変数に格納
7    var href = $(this).attr('href');
8 
9    // ③上で取得した値が#か空白だったら'html'を、それ以外だったら先ほど取得したhref属性の値を変数に格納
10    var target = $(href == '#' || href === '' ? 'html' : href);
11 
12    // ④変数targetのページトップからの位置を取得し、変数に格納
13    var position = target.offset().top;
14 
15    // ⑤scrollTopに上で取得した位置を設定し、ヌルヌルとスクロールさせる
16    $('html,body').animate({scrollTop : position}, 500);
17 
18    // ⑥a要素のデフォルトの機能を無効化する
19    return false;
20 
21  });
22});

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.