1var scrolltotop={ 2 setting:{ 3 startline:100, //èµ·å§è¡ 4 scrollto:0, //æ»å¨å°æå®ä½ç½® 5 scrollduration:400, //æ»å¨è¿æ¸¡æ¶é´ 6 fadeduration:[500,100] //æ·¡åºæ·¡ç°æ¶å¤± 7 }, 8 controlHTML:'<img src="" style="width:39px; height:40px; border:0;" />', //è¿åé¡¶é¨æé® 9 controlattrs:{offsetx:20,offsety:20},//è¿åæé®åºå®ä½ç½® 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}; 57scrolltotop.init();
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.