PageSourceSearch

https://www.lfnu.edu.cn/library/tpl/1681216182796/images/jquery2019.js

js lfnu.edu.cn collected 2026-10-08 22:01:48 UTC 2,449 bytes, 93 lines download raw bytes

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.