PageSourceSearch

https://www.documentaryjapan.com/js/sm_scroll.js

js documentaryjapan.com collected 2026-10-02 18:58:07 UTC 1,324 bytes, 54 lines download raw bytes

1
2/*
3   -----------------------------------------------------
4   スムーズスクロール
5   Ver. 1.0.0
6   update 2009.5.17
7   Copyright (C) WEB-JOZU  URL:http://www.web-jozu.com/
8   -----------------------------------------------------
9*/
10var smooth,speed,distYY;
11
12/* ---------- 設定領域 start ---------- */
13
14//滑らかさ(最適範囲2~10)
15//数値が大きいほど滑らかになりますが遅くなります。
16smooth = 10;
17
18//速さ(最適範囲70~10)
19//数値が小さい程早くなります。
20speed = 10;
21
22/* ---------- 設定領域 end ---------- */
23
24
25function scrlWin(){
26	var moveYY,timerId,smth = smooth,dY = distYY;
27	if(distYY >= 1 || dY <= -1){
28		moveYY = (dY > 0)? Math.ceil(dY / smth):moveYY = Math.floor(dY / smth);
29
30		dY -= moveYY;
31		window.scrollBy(0, -moveYY);
32		distYY = dY;
33		clearTimeout(timerId);
34		timerId = setTimeout("scrlWin()", speed);
35	}
36}
37
38function smScroll(ET){
39	var d = document,
40		scrollTop = d.documentElement.scrollTop||d.body.scrollTop,
41		winHH = db.clientHeight,
42		linkName = (ET == d.body)? ET:mB(ET),
43		targetYY = linkName.offsetTop,
44		pageHH = d.body.scrollHeight,
45		difVa,
46		timerId;
47	distYY = scrollTop - targetYY;
48	if(pageHH - targetYY < winHH){
49		difVal = winHH - (pageHH - targetYY) - 15;
50		distYY += difVal;
51	}
52
53	timerId = setTimeout("scrlWin()", speed);
54}

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.