亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

嗯,用JS這么寫

?window.onload=function(){
????var?wrap=document.getElementById('wrap'),
????????pic=document.getElementById('pic').getElementsByTagName('li'),
????????list=document.getElementById('list').getElementsByTagName('li'),
????????index=0,
????????timer=null;

??????//?定義并調用自動播放函數
		timer?=?setInterval(autoPlay,1500);
		
??????//?定義圖片切換函數
?????	function?changePic(curIndex){
			for(var?i=0;i<pic.length;i++){
				pic[i].style.display="none";
				list[i].className="";
				}
				pic[curIndex].style.display="block";
				list[curIndex].className="on";
				}
				
	?//設置自動播放函數(1~5循環)
		?function?autoPlay(){
			?if(++index>=pic.length){index=0};
			?changePic(index);}	
			?
?????//?鼠標劃過整個容器時停止自動播放
		wrap.onmouseover?=?function(){clearInterval(timer);}
		
?????//?鼠標離開整個容器時繼續播放至下一張
????	wrap.onmouseout?=?function(){timer?=?setInterval(autoPlay,1500);}
		
?????//?遍歷所有數字導航實現劃過切換至對應的圖片
		for(var?i=0;i<=pic.length;i++){
			list[i].onmouseover?=?function(){
				clearInterval(timer);
				index=this.innerText-1;
				changePic(index);
				};
			};	
???};


正在回答

1 回答

n你想問的是什么呀?


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

嗯,用JS這么寫

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號