PageSourceSearch

https://lens-smile.com/js/to-top.js?20261008122251

js lens-smile.com collected 2026-10-08 03:23:26 UTC 1,661 bytes, 64 lines download raw bytes

1
2
3// グローバル変数
4var syncerTimeout = null ;
5
6// 一連の処理
7$( function()
8{
9	// スクロールイベントの設定
10	$( window ).scroll( function()
11	{
12		// 1秒ごとに処理
13		if( syncerTimeout == null )
14		{
15			// セットタイムアウトを設定
16			syncerTimeout = setTimeout( function(){
17
18				// 対象のエレメント
19				var element = $( '#page-top' ) ;
20
21				// 現在、表示されているか?
22				var visible = element.is( ':visible' ) ;
23
24				// 最上部から現在位置までの距離を取得して、変数[now]に格納
25				var now = $( window ).scrollTop() ;
26
27				// 最下部から現在位置までの距離を計算して、変数[under]に格納
28				var under = $( 'body' ).height() - ( now + $(window).height() ) ;
29
30				// 最上部から現在位置までの距離(now)が1500以上かつ
31				// 最下部から現在位置までの距離(under)が200px以上かつ…
32				if( now > 500 && 0 < under )
33				{
34					// 非表示状態だったら
35					if( !visible )
36					{
37						// [#page-top]をゆっくりフェードインする
38						element.fadeIn( 'slow' ) ;
39					}
40				}
41
42				// 1500px以下かつ
43				// 表示状態だったら
44				else if( visible )
45				{
46					// [#page-top]をゆっくりフェードアウトする
47					element.fadeOut( 'slow' ) ;
48				}
49
50				// フラグを削除
51				syncerTimeout = null ;
52			} , 500 ) ;
53		}
54	} ) ;
55
56	// クリックイベントを設定する
57	$( '#move-page-top' ).click(
58		function()
59		{
60			// スムーズにスクロールする
61			$( 'html,body' ).animate( {scrollTop:0} , 'slow' ) ;
62		}
63	) ;
64} ) ;

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.