📄 radrotator.js
字号:
function RadRotator(O,o,ScrollDirection){ this.ClientID=O; this.SmoothScrollDelay=10; this.I=document.getElementById(O+"_Div"); this.A=document.getElementById(O+"_Frame\x43\x6fntaine\x72"); if (o){ this.o=o; }else { this.o=1; } this.A.style.top="0\x70x"; this.A.style.left="0px"; this.CurrentFrame=0; var U=this ; this.Z= function (e){U.z(e); } ; this.W= function (e){U.w(e); } ; this.V= function (e){U.OnMouseOver(e); } ; this.v= function (e){U.OnMouseOut(e); } ; this.T= function (){U.FixHeight(); } ; this.t(this.I,"\x6d\x6fuseenter",this.Z); this.t(this.I,"mous\x65\x6ceave",this.W); this.t(this.I,"\x6douseover",this.V); this.t(this.I,"\x6d\x6fuseout",this.v); var S=window[O]; if (S){S.R(); }} ; RadRotator.prototype.attachEvent= function (r,Q){var P=this.N(Q); var n= function (M,m){return P(M,m); };this[r+"\x48\x61ndler"]=n; } ; RadRotator.prototype.N= function (L){var n= function (M,m){} ; if (typeof(L).toString().toLowerCase()=="function"){n=L; }else if (typeof(L).toString().toLowerCase()=="\x73\x74ring"){try {n=eval(L);}catch (l){}}return n; };RadRotator.prototype.FireOnClientFrameChanging= function (M){if (this.OnClientFrameChangingHandler!=null){var n=this.OnClientFrameChangingHandler; return n(this, {} ); }};RadRotator.prototype.FireOnClientFrameChanged= function (M){ this.K(); var U=this ; if (this.RotatorMode.toLowerCase()=="\163cr\x6f\x6cl"){window.clearTimeout(this.k); this.k=0; this.k=window.setTimeout( function (){U.J();} ,this.FrameTimeout); }if (this.RotatorMode.toLowerCase()=="\x73\x6cideshow"){window.clearTimeout(this.H); this.H=0; this.H=window.setTimeout( function (){U.h();} ,this.FrameTimeout); }if (this.OnClientFrameChangedHandler!=null){var n=this.OnClientFrameChangedHandler; return n(this, {} ); }};RadRotator.prototype.G= function (max){return parseInt(((max*Math.random())%max)); } ; RadRotator.prototype.g= function (F){if (F){ this.f= true; }else { this.f= false; }} ; RadRotator.prototype.t= function (D,r,Q){try {if (document.all){D.attachEvent("o\x6e"+r,Q); }else {D.addEventListener(r,Q, true); }}catch (l){}} ; RadRotator.prototype.z= function (e){if (!this.AutoAdvance){return; }if (this.PauseOnMouseOver){ this.g( true); }};RadRotator.prototype.w= function (){if (!this.AutoAdvance){return; }if (this.PauseOnMouseOver){ this.g( false); }} ; RadRotator.prototype.OnMouseOver= function (){if (!this.AutoAdvance){return; }if (document.all && !window.opera){return; }if (this.PauseOnMouseOver){ this.g( true); }} ; RadRotator.prototype.OnMouseOut= function (){if (!this.AutoAdvance){return; }if (document.all && !window.opera){return; }if (this.PauseOnMouseOver){ this.g( false); }} ; RadRotator.prototype.d= function (id){var C="\137_doP\x6f\x73t\x42\x61ck(\x27"+this.c+"\047,\047"+id+"\x27)"; eval(C); return; } ; RadRotator.prototype.StartRotator= function (){ this.B= false; if (this.o0==0){return; } this.o0=0; this.AutoAdvance=1; if (this.RotatorMode.toLowerCase()=="\163croll"){ this.J(); }else { this.h(); }} ; RadRotator.prototype.StopRotator= function (){if (this.RotatorMode.toLowerCase()=="scroll"){ this.O0(); }else { this.l0(); }} ; RadRotator.prototype.l0= function (){ this.o0=1; this.AutoAdvance=0; } ; RadRotator.prototype.O0= function (){ this.o0=1; this.AutoAdvance=0; } ; RadRotator.prototype.Start= function (){ this.FixHeight(); this.K(); if (this.RotatorMode!=null && this.RotatorMode.toLowerCase()=="\x73\x63roll"){ this.i0(); var U=this ; window.clearTimeout(this.k); this.k=window.setTimeout( function (){U.J();} ,this.FrameTimeout); }if (this.RotatorMode!=null && this.RotatorMode.toLowerCase()=="slideshow"){var U=this ; window.clearTimeout(this.H); if (this.UseRandomSlide){U.h(); }else { this.H=window.setTimeout( function (){U.h();} ,this.FrameTimeout); }}} ; RadRotator.prototype.K= function (){if (this.HasTickers){ this.I0(); var o1=this.FrameIdArray; var O1=l1(this.I); for (var i=0; i<this.NumberOfFrames; i++){var i1=document.getElementById(o1[i]); var I1=l1(i1); if (O1.o2(I1)){eval(this[i1.id+"\137s"]); }}}} ; RadRotator.prototype.I0= function (){if (this.HasTickers){for (var i=0; i<this.NumberOfTickers; i++){eval(this.TickerIdArray[i]).ResetTicker(); }}} ; RadRotator.prototype.Freeze= function (){ this.B= true; };RadRotator.prototype.FixHeight= function (){var width; var height; if (null!=document.readyState && "co\x6d\x70\x6cet\x65"!=document.readyState){ this.t(window,"\x6c\x6fad",this.T); }if (parseInt(this.I.offsetWidth)>0){width=this.I.offsetWidth; }else {width=this.I.style.width; }if (parseInt(this.I.offsetHeight)>0){height=this.I.offsetHeight; }else {height=this.I.style.height; }if (this.RotatorMode.toLowerCase()=="scroll" && (this.ScrollDirection.toLowerCase()=="\x6c\x65ft" || this.ScrollDirection.toLowerCase()=="\x72\x69ght")){ this.O2=parseInt(width)/this.o; this.l2=parseInt(height); this.A.style.width=(this.O2*this.NumberOfFrames)+"\x70x"; }if (this.RotatorMode.toLowerCase()=="\x73croll" && (this.ScrollDirection.toLowerCase()=="u\x70" || this.ScrollDirection.toLowerCase()=="down")){ this.O2=parseInt(width); this.l2=parseInt(height)/this.o; this.A.style.height=(this.l2*this.NumberOfFrames)+"px"; }if (this.RotatorMode.toLowerCase()=="\x73\x6c\x69desh\x6fw"){ this.O2=parseInt(width); this.l2=parseInt(height); }var o1=this.FrameIdArray; for (var i=0; i<this.NumberOfFrames; i++){var i1=document.getElementById(o1[i]); i1.style.height=this.l2+"\160x"; i1.style.width=this.O2+"\x70x"; }} ; RadRotator.prototype.h= function (){if (this.NumberOfFrames/this.o<=1){return; }if (this.AutoAdvance){ this.ShowNextFrame(); }} ; RadRotator.prototype.i0= function (){if (this.ScrollDirection.toLowerCase()=="down"){ this.A.style.top=(this.NumberOfFrames-this.o)*this.l2*(-1)+"px"; }if (this.ScrollDirection.toLowerCase()=="right"){ this.A.style.left=(this.NumberOfFrames-this.o)*this.O2*(-1)+"\x70\x78"; } this.K(); };RadRotator.prototype.J= function (){if (this.NumberOfFrames/this.o<=1){return; }if (this.FireOnClientFrameChanging(this )== false){return; }if (this.AutoAdvance){ this.i2(); }} ; RadRotator.prototype.i2= function (){switch (this.ScrollDirection.toLowerCase()){case "\x75\x70":{ this.ScrollUpNextFrame(); break; }case "down":{ this.ScrollDownNextFrame(); break; }case "left":{ this.ScrollLeftNextFrame(); break; }case "right":{ this.ScrollRightNextFrame(); break; }}} ; RadRotator.prototype.ShowPrevFrame= function (){if (this.RotatorMode.toLowerCase()!="\x73\x6cidesho\x77"){alert("\x44o not c\x61\x6cl th\x69\x73 f\x75\156\x63tion w\x68\x65n r\x6ftat\x6fr is \x69\156 \x73croll\x69\156g\x20mode!"); return; } this.CurrentFrame=(this.CurrentFrame-2)%this.NumberOfFrames; if (this.CurrentFrame<-1){ this.CurrentFrame=this.NumberOfFrames-2; } this.ShowNextFrame(); } ; RadRotator.prototype.ShowNextFrame= function (){if (this.RotatorMode.toLowerCase()!="\x73\x6cidesho\x77"){alert("\x44o not call \x74\x68is \x66\x75nc\x74\x69on \x77\x68en \x72\157\x74ator i\x73\040\x69n scr\x6flling\x20\155o\x64e!"); return; }if (this.f){var U=this ; window.clearTimeout(this.H); this.H=0; this.H=window.setTimeout( function (){U.ShowNextFrame();} ,this.FrameTimeout); return; }if (this.FireOnClientFrameChanging(this )== false){return; }var Height; if (this.UseRandomSlide){ do {Height=this.G(this.NumberOfFrames)*this.l2*(-1); }while (Height==parseInt(this.A.style.top));}else { this.CurrentFrame=(this.CurrentFrame+1)%this.NumberOfFrames; Height=this.CurrentFrame*this.l2*(-1); }if (this.UseTransition && document.all && !window.opera){if (this.UseRandomEffect){ this.I.style.filter=this.TransitionStrings[this.G(17)]; }else { this.I.style.filter=this.TransitionString; } this.I.filters[0].Apply(); this.A.style.top=Height+"\x70\x78"; this.I.filters[0].Play(); }else { this.A.style.top=Height+"px"; } this.FireOnClientFrameChanged(); } ; RadRotator.prototype.ScrollLeftNextFrame= function (){if (this.RotatorMode.toLowerCase()!="\x73croll"){alert("\x44o not cal\x6c\x20this\x20\x66u\x6e\x63tio\x6e\x20whe\x6e\x20\x72otator\x20\151\x73 in s\x6c\151d\x65show \x6dode!"); return; }if (this.ScrollDirection.toLowerCase()=="up" || this.ScrollDirection.toLowerCase()=="dow\x6e"){alert("Do n\x6f\x74 call\x20\x74his\x20\146u\x6e\x63tio\x6e\x20whe\x6e\040\x72otato\x72 is in\x20verti\x63\141l\x20scrol\x6cing m\x6fde!"); return; }if (this.B){return; }if (this.f){var U=this ; this.I2=0; this.I2=window.setTimeout( function (){U.ScrollLeftNextFrame();} ,this.ScrollSpeed);return; }if (parseInt(this.A.style.left)>this.O2*(-1)){ this.o3= true; if (!this.UseSmoothScroll){ this.A.style.left=(parseInt(this.A.style.left)-1)+"\x70x"; }else {var O3=(this.O2*(-1)-parseInt(this.A.style.left))/this.SmoothScrollDelay; this.A.style.left=(parseInt(this.A.style.left)+O3-1)+"\x70x"; }var U=this ; this.I2=0; this.I2=window.setTimeout( function (){U.ScrollLeftNextFrame();} ,this.ScrollSpeed); }else {var l3=this.A.firstChild.firstChild.firstChild; this.A.firstChild.firstChild.removeChild(this.A.firstChild.firstChild.firstChild); this.A.firstChild.firstChild.appendChild(l3); this.A.style.left="0px"; this.CurrentFrame=(this.CurrentFrame+1)%this.NumberOfFrames; this.FireOnClientFrameChanged(); this.o3= false; }} ; RadRotator.prototype.ScrollRightNextFrame= function (){if (this.RotatorMode.toLowerCase()!="\x73croll"){alert("Do\x20\x6eot cal\x6c\x20this\x20functio\x6e\x20whe\x6e\040\x72ota\x74\157r\x20\151s\x20\151n\x20slide\x73\150o\x77 mod\x65\041"); return; }if (this.ScrollDirection.toLowerCase()=="up" || this.ScrollDirection.toLowerCase()=="down"){alert("D\x6f\x20not cal\x6c\040\x74\x68is \x66\x75nct\x69\x6fn w\x68\145n\x20rotato\x72\040i\x73 in v\x65\162t\x69cal s\x63\162\x6f\154\x6cing\x20mode\x21"); return; }if (this.B){return; }if (this.f){var U=this ; this.I2=0; this.I2=window.setTimeout( function (){U.ScrollRightNextFrame();} ,this.ScrollSpeed);return; }if (parseInt(this.A.style.left)<this.O2*(this.NumberOfFrames-this.o-1)*(-1)){ this.o3= true; if (!this.UseSmoothScroll){ this.A.style.left=parseInt(this.A.style.left)+1+"px"; }else {var O3=(((this.NumberOfFrames-this.o)*this.O2*(-1)+this.O2)-parseInt(this.A.style.left))/this.SmoothScrollDelay; this.A.style.left=parseInt(this.A.style.left)+O3+"p\x78"; }var U=this ; this.I2=0; this.I2=window.setTimeout( function (){U.ScrollRightNextFrame();} ,this.ScrollSpeed); }else {var l3=this.A.firstChild.firstChild.lastChild; this.A.firstChild.firstChild.removeChild(this.A.firstChild.firstChild.lastChild); this.A.firstChild.firstChild.insertBefore(l3,this.A.firstChild.firstChild.firstChild); this.A.style.left=(this.NumberOfFrames-this.o)*this.O2*(-1)+"px"; this.CurrentFrame=(this.CurrentFrame+1)%this.NumberOfFrames; this.FireOnClientFrameChanged(); this.o3= false; }} ; RadRotator.prototype.ScrollDownNextFrame= function (){if (this.RotatorMode.toLowerCase()!="\x73croll"){alert("\x44o not \x63\x61ll t\x68\x69s \x66\x75nct\x69\x6fn \x77\x68en \x72ota\x74\x6fr \x69\163\x20in sl\x69\144e\x73how m\x6fde!"); return; }if (this.ScrollDirection.toLowerCase()=="\x72ight" || this.ScrollDirection.toLowerCase()=="\x6ceft"){alert("Do not cal\x6c\x20this\x20\x66unc\x74\x69on \x77\x68en \x72otator\x20\151s\x20in hor\x69\172o\x6etal s\x63\162o\x6cling\x20\155\x6fde!"); return; }if (this.B){return; }if (this.f){var U=this ; this.I2=0; this.I2=window.setTimeout( function (){U.ScrollDownNextFrame();} ,this.ScrollSpeed);return; }if (parseInt(this.A.style.top)<(this.NumberOfFrames-this.o)*this.l2*(-1)+this.l2){ this.o3= true; if (!this.UseSmoothScroll){ this.A.style.top=parseInt(this.A.style.top)+1+"p\x78"; }else {var O3=(((this.NumberOfFrames-this.o)*this.l2*(-1)+this.l2)-parseInt(this.A.style.top))/this.SmoothScrollDelay; this.A.style.top=parseInt(this.A.style.top)+O3+"\x70x"; }var U=this ; this.I2=0; this.I2=window.setTimeout( function (){U.ScrollDownNextFrame();} ,this.ScrollSpeed); }else {var l3=this.A.lastChild; this.A.removeChild(this.A.lastChild); this.A.insertBefore(l3,this.A.firstChild); this.A.style.top=(this.NumberOfFrames-this.o)*this.l2*(-1)+"\160x"; this.CurrentFrame=(this.CurrentFrame+1)%this.NumberOfFrames; this.FireOnClientFrameChanged(); this.o3= false; }} ; RadRotator.prototype.ScrollUpNextFrame= function (){if (this.RotatorMode.toLowerCase()!="scrol\x6c"){alert("\x44o not call \x74\x68is f\x75\156\x63tion wh\x65\156 r\x6f\164\x61tor i\x73\040\x69n sli\x64\145s\x68ow mo\x64\145\x21"); return; }if (this.ScrollDirection.toLowerCase()=="\x72ight" || this.ScrollDirection.toLowerCase()=="left"){alert("\x44o no\x74\x20call \x74\x68is \x66\x75nct\x69\x6fn w\x68\145n\x20rotat\x6f\x72 i\x73\040i\x6e hori\x7a\157n\x74al sc\x72olli\x6eg m\x6fde!"); return; }if (this.B){return; }if (this.f){var U=this ; this.I2=0; this.I2=window.setTimeout( function (){U.ScrollUpNextFrame();} ,this.ScrollSpeed);return; }if (parseInt(this.A.style.top)>this.l2*(-1)){ this.o3= true; if (!this.UseSmoothScroll){ this.A.style.top=(parseInt(this.A.style.top)-1)+"p\x78"; }else {var O3=(this.l2*(-1)-parseInt(this.A.style.top))/this.SmoothScrollDelay; this.A.style.top=(parseInt(this.A.style.top)+O3-1)+"px"; }var U=this ; this.I2=0; this.I2=window.setTimeout( function (){U.ScrollUpNextFrame();} ,this.ScrollSpeed); }else {try {var l3=this.A.firstChild; this.A.removeChild(this.A.firstChild); this.A.appendChild(l3); this.A.style.top="\x30px"; this.CurrentFrame=(this.CurrentFrame+1)%this.NumberOfFrames; this.FireOnClientFrameChanged(); this.o3= false; }catch (e){alert(e); }}} ; function i3(left,top,width,height){ this.left=(null!=left?left: 0); this.top=(null!=top?top: 0); this.width=(null!=width?width: 0); this.height=(null!=height?height: 0); this.right=left+width; this.bottom=top+height; } ; i3.prototype.I3= function (){return new i3(this.left,this.top,this.width,this.height); } ; i3.prototype.o4= function (x,y){return (this.left<=x && x<=(this.left+this.width) && this.top<=y && y<=(this.top+this.height)); } ; i3.prototype.o2= function (O4){if (null==O4){return false; }if (this ==O4){return true; }return (O4.left<this.right && O4.top<this.bottom && O4.right>this.left && O4.bottom>this.top); } ; i3.prototype.l4= function (O4){if (null==O4){return false; }if (this ==O4){return this.I3(); }if (!this.o2(O4)){return new i3(); }var left=Math.max(this.left,O4.left); var top=Math.max(this.top,O4.top); var right=Math.min(this.right,O4.right); var bottom=Math.min(this.bottom,O4.bottom); return new i3(left,right,right-left,bottom-top); } ; RadRotator.prototype.R= function (){window.clearTimeout(this.k); window.clearTimeout(this.H); window.clearTimeout(this.I2); } ; function l1(D){if (!D){D=this ; }var left=0; var top=0; var width=D.offsetWidth; var height=D.offsetHeight; while (D.offsetParent){left+=D.offsetLeft; top+=D.offsetTop; D=D.offsetParent; }if (D.x){left=D.x; }if (D.y){top=D.y; }return new i3(left,top,width,height); } ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -