1window.onload=function(){ 2 var imgs_div=document.getElementById("imgs"); 3 var nav_div=document.getElementById("nav"); 4 //è·åå°å¾çè½®æçul对象æ°ç» 5 var imgsUl=imgs_div.getElementsByTagName("ul")[0]; 6 //è·åå°è¿ç¹çul对象æ°ç» 7 var nav=nav_div.getElementsByTagName("ul")[0]; 8 //ä¸ä¸ä¸ª 9 var prious=document.getElementById("preous"); 10 //ä¸ä¸ä¸ª 11 var next =document.getElementById("next"); 12 var timer; 13 var animTimer; 14 var index=1; 15 play(); 16 prious.onclick=function(){ 17 initImgs(index); 18 index-=1; 19 if(index<1){ 20 index=5; 21 } 22 animate(384); 23 btnShow(index); 24 } 25 next.onclick=function(){ 26 initImgs(index); 27 index+=1; 28 if(index>5){ 29 index=1; 30 } 31 animate(-384); 32 btnShow(index); 33 } 34 35 function animate(offset){ 36 var newLeft=parseInt(imgsUl.offsetLeft)+offset; 37 // imgsUl.style.left=newLeft; 38 // console.log("宿¶å¨å¤é¢:æ¤æ¶offsetLeft"+imgsUl.offsetLeft+">>newLeft:"+newLeft); 39 if(newLeft>-384){ 40 // imgsUl.style.left=-5120+"px"; 41 donghua(-1536); 42 }else if(newLeft<-1536){ 43 // imgsUl.style.left=-1280+"px"; 44 donghua(-384); 45 }else{ 46 donghua(newLeft); 47 } 48 49 } 50 function donghua(offset){ 51 clearInterval(animTimer); 52 animTimer=setInterval(function(){ 53 imgsUl.style.left=imgsUl.offsetLeft+(offset-imgsUl.offsetLeft)/10 + "px"; 54 if(imgsUl.offsetLeft-offset<10&&imgsUl.offsetLeft-offset>-10){//妿åç§»éå·²ç»çäºæå®å¥½çåç§»éï¼å秦æ¥å®æ¶å¨ 55 imgsUl.style.left=offset+"px"; 56 clearInterval(animTimer); 57 //å¼å¯å®æ¶è½®æ 58 play(); 59 } 60 },20); 61 } 62 function initImgs(cur_index){ 63 clearInterval(timer); 64 clearInterval(animTimer); 65 var off=cur_index*384; 66 imgsUl.style.left=-off+"px"; 67 } 68 function play(){ 69 timer=setInterval(function(){ 70 next.onclick(); 71 },2000) 72 } 73 function btnShow(cur_index){ 74 var list=nav.children; 75 for(var i=0;i<nav.children.length;i++){ 76 nav.children[i].children[0].className="hidden"; 77 } 78 nav.children[cur_index-1].children[0].className="current"; 79 } 80 for(var i=0;i<nav.children.length;i++){ 81 nav.children[i].index=i; 82 var sd=nav.children[i].index; 83 nav.children[i].onmouseover=function(){ 84 index=this.index+1; 85 initImgs(this.index+1); 86 btnShow(this.index+1); 87 } 88 nav.children[i].onmouseout=function(){ 89 play(); 90 } 91 } 92 93 }
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.