求大神帮帮忙

<script language="javascript">
	var numslides=0;
	var currentslide=0;
	var oldslide=4;
	var x=0;
	var slide = new Array();
	
	function MakeSlideShow(){
		imags = document.getElementsByTagName("img");
		for(i=0;i<imags.length;i++){
		for(imags[i].className!="slide")
			continue;
		
		slides[numslides]=img[i];
		if(numslides=0){
			imags[i].style.zIndex=4;
		}
		else{
			imags[i].style.zIndex=0;
		}
		imgs[i].onclick = NextSlide;
		numslides++;
		}
		
		function NextSlide(){
			slide[currentslide].style.zIndex=4;
			slide[oldslide].style.zIndex=0;
			oldslide = currentslide;
			currentslide++;
			if(currentslide>=numslides)
				currentslide=0;
			slide[currentslide].style.left=490;
			x=490;
			slide[currentslide].style.zIndex=4;
			AnimateSlide();
		}
			function AnimateSlide(){
				x=x-1;
				slide[currentslide].style.left=x;
				slide[oldslide].style.left=x-490;
				if(x>0)window.setTimeout("AnimaTeSlid();",5)
			}
			window.onload = MakeSlideShow;
	}
</script>

在浏览器看见了11行出错了,不太会弄。

慕哥4077377
浏览 1163回答 1
1回答

qq_青枣工作室_0

11行的 for(imags[i].className!="slide") 改为 if(imags[i].className!="slide") 
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript