PageSourceSearch

https://r4ids.cn/scroll.js

js r4ids.cn collected 2026-10-06 16:46:48 UTC 5,062 bytes, 140 lines download raw bytes

1// JavaScript Document
2function srcMarquee(){
3this.ID = document.getElementById(arguments[0]);
4if(!this.ID){this.ID = -1;return;}
5this.Direction = this.Width = this.Height = this.DelayTime = this.WaitTime = this.Correct = this.CTL = this.StartID = this.Stop = this.MouseOver = 0;
6this.Step = 1;
7this.Timer = 30;
8this.DirectionArray = {"top":0 , "bottom":1 , "left":2 , "right":3};
9if(typeof arguments[1] == "number")this.Direction = arguments[1];
10if(typeof arguments[2] == "number")this.Step = arguments[2];
11if(typeof arguments[3] == "number")this.Width = arguments[3];
12if(typeof arguments[4] == "number")this.Height = arguments[4];
13if(typeof arguments[5] == "number")this.Timer = arguments[5];
14if(typeof arguments[6] == "number")this.DelayTime = arguments[6];
15if(typeof arguments[7] == "number")this.WaitTime = arguments[7];
16if(typeof arguments[8] == "number")this.ScrollStep = arguments[8]
17this.ID.style.overflow = this.ID.style.overflowX = this.ID.style.overflowY = "hidden";
18this.ID.noWrap = true;
19this.IsNotOpera = (navigator.userAgent.toLowerCase().indexOf("opera") == -1);
20if(arguments.length >= 7)this.Start();
21}
22srcMarquee.prototype.Start = function(){
23if(this.ID == -1)return;
24if(this.WaitTime < 800)this.WaitTime = 800;
25if(this.Timer < 20)this.Timer = 20;
26if(this.Width == 0)this.Width = parseInt(this.ID.style.width);
27if(this.Height == 0)this.Height = parseInt(this.ID.style.height);
28if(typeof this.Direction == "string")this.Direction = this.DirectionArray[this.Direction.toString().toLowerCase()];
29this.HalfWidth = Math.round(this.Width / 2);
30this.BakStep = this.Step;
31this.ID.style.width = this.Width;
32this.ID.style.height = this.Height;
33if(typeof this.ScrollStep != "number")this.ScrollStep = this.Direction > 1 ? this.Width : this.Height;
34var msobj = this;
35var timer = this.Timer;
36var delaytime = this.DelayTime;
37var waittime = this.WaitTime;
38msobj.StartID = function(){msobj.Scroll()}
39msobj.Continue = function(){
40if(msobj.MouseOver == 1){
41setTimeout(msobj.Continue,delaytime);
42     }
43     else{ clearInterval(msobj.TimerID);
44msobj.CTL = msobj.Stop = 0;
45msobj.TimerID = setInterval(msobj.StartID,timer);
46     }
47    }
48msobj.Pause = function(){
49msobj.Stop = 1;
50clearInterval(msobj.TimerID);
51setTimeout(msobj.Continue,delaytime);
52    }
53msobj.Begin = function(){
54   msobj.ClientScroll = msobj.Direction > 1 ? msobj.ID.scrollWidth : msobj.ID.scrollHeight;
55   if((msobj.Direction <= 1 && msobj.ClientScroll <msobj.Height) || (msobj.Direction > 1 && msobj.ClientScroll <msobj.Width))return;
56   msobj.ID.innerHTML += msobj.ID.innerHTML;
57   msobj.TimerID = setInterval(msobj.StartID,timer);
58   if(msobj.ScrollStep < 0)return;
59   msobj.ID.onmousemove = function(event){
60       if(msobj.ScrollStep == 0 && msobj.Direction > 1){
61var event = event || window.event;
62if(window.event){
63if(msobj.IsNotOpera){msobj.EventLeft = event.srcElement.id == msobj.ID.id ? event.offsetX - msobj.ID.scrollLeft : event.srcElement.offsetLeft - msobj.ID.scrollLeft + event.offsetX;}
64else{msobj.ScrollStep = null;return;}
65}
66else{msobj.EventLeft = event.layerX - msobj.ID.scrollLeft;}
67msobj.Direction = msobj.EventLeft > msobj.HalfWidth ? 3 : 2;
68msobj.AbsCenter = Math.abs(msobj.HalfWidth - msobj.EventLeft);
69msobj.Step = Math.round(msobj.AbsCenter * (msobj.BakStep*2) / msobj.HalfWidth);
70}
71}
72msobj.ID.onmouseover = function(){
73if(msobj.ScrollStep == 0)return;
74msobj.MouseOver = 1;
75clearInterval(msobj.TimerID);
76}
77msobj.ID.onmouseout = function(){
78if(msobj.ScrollStep == 0){
79if(msobj.Step == 0)msobj.Step = 1;
80return;
81}
82msobj.MouseOver = 0;
83if(msobj.Stop == 0){
84clearInterval(msobj.TimerID);
85msobj.TimerID = setInterval(msobj.StartID,timer);
86}}}
87setTimeout(msobj.Begin,waittime);
88}
89srcMarquee.prototype.Scroll = function(){
90switch(this.Direction){
91case 0:
92this.CTL += this.Step;
93if(this.CTL >= this.ScrollStep && this.DelayTime > 0){
94this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL;
95this.Pause();
96return;
97}
98else{
99if(this.ID.scrollTop >= this.ClientScroll){this.ID.scrollTop -= this.ClientScroll;}
100this.ID.scrollTop += this.Step;
101}
102break;
103case 1:
104this.CTL += this.Step;
105if(this.CTL >= this.ScrollStep && this.DelayTime > 0){
106this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL;
107this.Pause();
108return;
109}
110else{
111if(this.ID.scrollTop <= 0){this.ID.scrollTop += this.ClientScroll;}
112this.ID.scrollTop -= this.Step;
113}
114break;
115case 2:
116this.CTL += this.Step;
117if(this.CTL >= this.ScrollStep && this.DelayTime > 0){
118this.ID.scrollLeft += this.ScrollStep + this.Step - this.CTL;
119this.Pause();
120return;
121}
122else{
123if(this.ID.scrollLeft >= this.ClientScroll){this.ID.scrollLeft -= this.ClientScroll;}
124this.ID.scrollLeft += this.Step;
125}
126break;
127case 3:
128this.CTL += this.Step;
129if(this.CTL >= this.ScrollStep && this.DelayTime > 0){
130this.ID.scrollLeft -= this.ScrollStep + this.Step - this.CTL;
131this.Pause();
132return;
133}
134else{
135if(this.ID.scrollLeft <= 0){this.ID.scrollLeft += this.ClientScroll;}
136this.ID.scrollLeft -= this.Step;
137}
138break;
139}
140} 

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.