PageSourceSearch

https://ojo-chan.com/js/pagetotop.js

js ojo-chan.com collected 2026-10-04 11:42:18 UTC 1,157 bytes, 35 lines download raw bytes

1// 任意の場所までスクロールするとコンテンツを表示する
2$(function(){
3   // スクロールすると表示するエリア
4   var element = $('#pagetop');
5   // スクロール量の設定
6   var position = 500; // 単位:px
7   // スクロールすると表示するエリアを非表示
8   element.hide();
9   $(window).scroll(function(){
10      // スクロールすると表示させる
11      if ($(this).scrollTop() > position) {
12         $(element).fadeIn();
13      } else {
14         $(element).fadeOut();
15      }
16   });
17});
18
19// スムーススクロール
20$(function(){
21   // #で始まるアンカーをクリックした場合に処理
22   $('a[href^=#]').click(function() {
23      // スクロールの速度
24      var speed = 400;// ミリ秒
25      // アンカーの値取得
26      var href= $(this).attr("href");
27      // 移動先を取得
28      var target = $(href == "#" || href == "" ? 'html' : href);
29      // 移動先を数値で取得
30      var position = target.offset().top-48;
31      // スムーススクロール
32      $('html, body').animate({scrollTop:position}, speed, 'swing');
33      return false;
34   });
35});

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.