1 2//è¿åé¡¶é¨-------------------------- 3 4//页å¨å è½½å®å触å 5window.onload = function(){ 6 var obtn = document.getElementById('btn'); 7 //è·å页é¢å¯è§åºçé«åº¦ 8 var clientHeight = document.documentElement.clientHeight; 9 var timer = null; 10 var isTop = true; 11 12 13 //æ»å¨æ¡æ»å¨æ¶è§¦å 14 window.onscroll = function(){ 15 var osTop = document.documentElement.scrollTop ||document.body.scrollTop; 16 if(osTop >= clientHeight){ 17 obtn.style.display = 'block'; 18 }else{ 19 obtn.style.display = 'none'; 20 } 21 22 if(!isTop){ 23 clearInterval(timer); 24 } 25 isTop = false; 26 } 27 obtn.onclick = function(){ 28 29 //è®¾ç½®å®æ¶å¨ 30 timer = setInterval(function(){ 31 //è·åæ»å¨æ¡è·ç¦»é¡¶é¨çé«åº¦ 32 var osTop = document.documentElement.scrollTop ||document.body.scrollTop; 33 var ispeed = Math.floor(-osTop / 6) ; 34 document.documentElement.scrollTop = document.body.scrollTop -= osTop + ispeed; 35 36 isTop = true; 37 console.log(osTop -ispeed); 38 if(osTop == 0){ 39 clearInterval(timer); 40 } 41 },30); 42 43 } 44} 45
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.