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

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

這段代碼是什么意思

function change(curIndex){ ? ?

pic.style.marginTop=-170*curIndex+'px'; ? ?

for(var n=0;n<list.length;n++){ ? ?

list[n].className=''; ? ?

} ? ?

list[curIndex].className='on'; ? ?

index=curIndex; ? ?

} ? ?

wrap.onmouseover=function(){ ? ?

clearInterval(timer); ? ?

} ? ?

wrap.onmouseout=auto; ? ?

for(var i=0;i<list.length;i++){ ? ?

list[i].id=i; ? ?

list[i].onmouseover=function(){ ? ?

change(this.id); ? ?

} ? ?

} ? ?


正在回答

2 回答

wrap.onmouseout=auto; ? 這里是當鼠標移出容器時恢復自動播放,

wrap.onmouseout=function() {timer=setInterval(autoPlay,1000);}這是我的寫法,至于這里為什么用auto就不清楚了

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

function change(curIndex){ ? ?????????????????????????????????????//這是切換位置的函數

????pic.style.marginTop=-170*curIndex+'px'; ? ??????????//這里的pic是整個圖片列表的ul,通過改變上邊距來讓不

????????????????????????????????????????????????????????????????????????????????? ?//同位置的圖片顯示在窗口中,從而達到切換圖片的效果

????for(var n=0;n<list.length;n++){ ? ??????????????????????????//這里是把所有數字導航樣式去掉

????????list[n].className=''; ? ?

????} ? ?

????list[curIndex].className='on'; ? ?????????????????????????? //是當前的數字導航高亮

????index=curIndex; ? ?????????????????????????????????????????????????//更新索引

} ? ?

wrap.onmouseover=function(){ ? ?????????????????????????????//鼠標滑過容器的時候去除自動播放

????clearInterval(timer); ? ?

} ? ?

wrap.onmouseout=auto; ? ?????????????????????????????????????? ?//這里就不清楚了,你的代碼沒復制全,從這些代碼中

????????????????????????????????????????????????????????????????????????????????? ?//只能分析出這些作用

for(var i=0;i<list.length;i++){ ? ??????????????????????????????????//這里是鼠標滑過數字導航時移動到對應圖片上

????list[i].id=i; ? ?

????list[i].onmouseover=function(){ ? ?

????????change(this.id); ? ?

????} ? ?

} ? ?


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

舉報

0/150
提交
取消

這段代碼是什么意思

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

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

幫助反饋 APP下載

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

公眾號

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