PageSourceSearch

https://zhhchj.com/templets/default/js/top.js

js zhhchj.com collected 2026-10-06 13:16:50 UTC 1,358 bytes, 45 lines download raw bytes

1 var oTop=document.getElementById('toTop');
2	 x0=(document.body.clientWidth-1200)/2+1200;
3	 oTop.style.marginLeft=x0+10+"px";
4	 
5/**
6* JavaScript½Å±¾ÊµÏֻص½Ò³Ãæ¶¥²¿Ê¾Àý
7* @param acceleration ËÙ¶È
8* @param stime ʱ¼ä¼ä¸ô (ºÁÃë)
9**/
10function gotoTop(acceleration,stime) {
11   acceleration = acceleration || 0.1;
12   stime = stime || 10;
13   var x1 = 0;
14   var y1 = 0;
15   var x2 = 0;
16   var y2 = 0;
17   var x3 = 0;
18   var y3 = 0; 
19   if (document.documentElement) {
20       x1 = document.documentElement.scrollLeft || 0;
21       y1 = document.documentElement.scrollTop || 0;
22   }
23   if (document.body) {
24       x2 = document.body.scrollLeft || 0;
25       y2 = document.body.scrollTop || 0;
26   }
27   var x3 = window.scrollX || 0;
28   var y3 = window.scrollY || 0;
29 
30   // ¹ö¶¯Ìõµ½Ò³Ãæ¶¥²¿µÄˮƽ¾àÀë
31   var x = Math.max(x1, Math.max(x2, x3));
32   // ¹ö¶¯Ìõµ½Ò³Ãæ¶¥²¿µÄ´¹Ö±¾àÀë
33   var y = Math.max(y1, Math.max(y2, y3));
34 
35   // ¹ö¶¯¾àÀë = Ŀǰ¾àÀë / ËÙ¶È, ÒòΪ¾àÀëÔ­À´Ô½Ð¡, ËÙ¶ÈÊÇ´óÓÚ 1 µÄÊý, ËùÒÔ¹ö¶¯¾àÀë»áÔ½À´Ô½Ð¡
36   var speeding = 1 + acceleration;
37   window.scrollTo(Math.floor(x / speeding), Math.floor(y / speeding));
38 
39   // Èç¹û¾àÀ벻ΪÁã, ¼ÌÐøµ÷Óú¯Êý
40   if(x > 0 || y > 0) {
41       var run = "gotoTop(" + acceleration + ", " + stime + ")";
42       window.setTimeout(run, stime);
43   }
44}
45//ËØ²Ä¼ÒÔ° - www.sucaijiayuan.com

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.