PageSourceSearch

https://www.c-fol.net/js/scrolltopcontrol.js

js c-fol.net collected 2026-10-09 04:29:04 UTC 2,713 bytes, 56 lines download raw bytes

1var scrolltotop={
2	setting:{
3		startline:100, //ÆðʼÐÐ
4		scrollto:0, //¹ö¶¯µ½Ö¸¶¨Î»ÖÃ
5		scrollduration:400, //¹ö¶¯¹ý¶Éʱ¼ä
6		fadeduration:[500,100] //µ­³öµ­ÏÖÏûʧ
7	},
8	controlHTML:'<img src="http://www.c-fol.net/images/201904/topback.gif" style="width:54px; height:54px; border:0;" />', //·µ»Ø¶¥²¿°´Å¥
9	controlattrs:{offsetx:30,offsety:80},//·µ»Ø°´Å¥¹Ì¶¨Î»ÖÃ
10	anchorkeyword:"#top",
11	state:{
12		isvisible:false,
13		shouldvisible:false
14	},scrollup:function(){
15		if(!this.cssfixedsupport){
16			this.$control.css({opacity:0});
17		}
18		var dest=isNaN(this.setting.scrollto)?this.setting.scrollto:parseInt(this.setting.scrollto);
19		if(typeof dest=="string"&&jQuery("#"+dest).length==1){
20			dest=jQuery("#"+dest).offset().top;
21		}else{
22			dest=0;
23		}
24		this.$body.animate({scrollTop:dest},this.setting.scrollduration);
25	},keepfixed:function(){
26		var $window=jQuery(window);
27		var controlx=$window.scrollLeft()+$window.width()-this.$control.width()-this.controlattrs.offsetx;
28		var controly=$window.scrollTop()+$window.height()-this.$control.height()-this.controlattrs.offsety;
29		this.$control.css({left:controlx+"px",top:controly+"px"});
30	},togglecontrol:function(){
31		var scrolltop=jQuery(window).scrollTop();
32		if(!this.cssfixedsupport){
33			this.keepfixed();
34		}
35		this.state.shouldvisible=(scrolltop>=this.setting.startline)?true:false;
36		if(this.state.shouldvisible&&!this.state.isvisible){
37			this.$control.stop().animate({opacity:1},this.setting.fadeduration[0]);
38			this.state.isvisible=true;
39		}else{
40			if(this.state.shouldvisible==false&&this.state.isvisible){
41				this.$control.stop().animate({opacity:0}
41,this.setting.fadeduration[1]);
42				this.state.isvisible=false;
43			}
44		}
45	},init:function(){
46		jQuery(document).ready(function($){
47			var mainobj=scrolltotop;
48			var iebrws=document.all;
49			mainobj.cssfixedsupport=!iebrws||iebrws&&document.compatMode=="CSS1Compat"&&window.XMLHttpRequest;
50			mainobj.$body=(window.opera)?(document.compatMode=="CSS1Compat"?$("html"):$("body")):$("html,body");
51			mainobj.$control=$('<div id="topcontrol">'+mainobj.controlHTML+"</div>").css({position:mainobj.cssfixedsupport?"fixed":"absolute",bottom:mainobj.controlattrs.offsety,right:mainobj.controlattrs.offsetx,opacity:0,cursor:"pointer"}).attr({title:"·µ»Ø¶¥²¿"}).click(function(){mainobj.scrollup();return false;}).appendTo("body");if(document.all&&!window.XMLHttpRequest&&mainobj.$control.text()!=""){mainobj.$control.css({width:mainobj.$control.width()});}mainobj.togglecontrol();
52			$('a[href="'+mainobj.anchorkeyword+'"]').click(function(){mainobj.scrollup();return false;});
53			$(window).bind("scroll resize",function(e){mainobj.togglecontrol();});
54		});
55	}
56};

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.