第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

為什么綁定事件沒(méi)有反應(yīng)呢,檢查好久了。真心求幫助

為什么綁定事件沒(méi)有反應(yīng)呢,檢查好久了。真心求幫助

<!DOCTYPE?html> <html> <head> <meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/> <title>練習(xí)題</title> </head> <body> <img?src="#"?id="pic"> <button?id="next"?onclick="next()">next</button> <p?id="description">description</p> <script> function?showPic(){ var?Pic?=?document.getElementById("pic"); var?num?=?null; var?text?=?document.getElementById("description"); var?next?=?document.getElementById("next"); var?list?=?new?Object(); var?list?=?[ {"src":"img/weather/2日8時(shí)-3日8時(shí)降水量.jpg","href":"http://www.nmc.cn/publish/precipitation/1-7day-precipitation.html","title":"3月2日8時(shí)-3日8時(shí)全國(guó)降水量預(yù)報(bào)"}, {"src":"img/weather/2日8時(shí)-3日8時(shí)最低氣溫.jpg","href":"http://www.nmc.cn/publish/temperature/low.html","title":"3月2日8時(shí)-3日8時(shí)全國(guó)最低氣溫預(yù)報(bào)"}, {"src":"img/weather/3日8時(shí)-4日8時(shí)最高氣溫.jpg","href":"http://www.nmc.cn/publish/temperature/hight.html","title":"3月3日8時(shí)-3月4日8時(shí)全國(guó)最高氣溫預(yù)報(bào)"}, {"src":"img/weather/2日8時(shí)-3日8時(shí)短時(shí)強(qiáng)降水.png","href":"http://www.nmc.cn/publish/bulletin/index.html","title":"3月2日8時(shí)-3月3日8時(shí)全國(guó)短時(shí)強(qiáng)降水預(yù)報(bào)"}, {"src":"img/weather/3日8時(shí)-4日8時(shí)降水量.jpg","href":"http://www.nmc.cn/publish/precipitation/1-7day-precipitation.html","title":"3月3日8時(shí)-3月4日8時(shí)全國(guó)降水量預(yù)報(bào)"}, {"src":"img/weather/4日8時(shí)-5日8時(shí)降水量.jpg","href":"http://www.nmc.cn/publish/precipitation/1-7day-precipitation.html","title":"3月4日8時(shí)-3月5日8時(shí)全國(guó)降水量預(yù)報(bào)"} ] function?turnPic(){ if(num?==?list.length-1){ num?=?0; Pic.setAttribute("src",list[0].src); ????????Pic.setAttribute("title",list[0].title); ????????text.innerHTML?=?list[0].title; }? else{ num+=1; } Pic.setAttribute("src",list[num].src); Pic.setAttribute("title",list[num].title); text.innerHTML?=?list[num].title; Pic.timer?=?setTimeout(arguments.callee,5000); index?=?{}; index.num?=?num; } turnPic(); } function?next(){ var?Pic?=?document.getElementById("pic"); var?src?=?Pic.getAttribute("src"); var?text?=?document.getElementById("description"); var?list?=?[ {"src":"img/weather/2日8時(shí)-3日8時(shí)降水量.jpg","href":"http://www.nmc.cn/publish/precipitation/1-7day-precipitation.html","title":"3月2日8時(shí)-3日8時(shí)全國(guó)降水量預(yù)報(bào)"}, {"src":"img/weather/2日8時(shí)-3日8時(shí)最低氣溫.jpg","href":"http://www.nmc.cn/publish/temperature/low.html","title":"3月2日8時(shí)-3日8時(shí)全國(guó)最低氣溫預(yù)報(bào)"}, {"src":"img/weather/3日8時(shí)-4日8時(shí)最高氣溫.jpg","href":"http://www.nmc.cn/publish/temperature/hight.html","title":"3月3日8時(shí)-3月4日8時(shí)全國(guó)最高氣溫預(yù)報(bào)"}, {"src":"img/weather/2日8時(shí)-3日8時(shí)短時(shí)強(qiáng)降水.png","href":"http://www.nmc.cn/publish/bulletin/index.html","title":"3月2日8時(shí)-3月3日8時(shí)全國(guó)短時(shí)強(qiáng)降水預(yù)報(bào)"}, {"src":"img/weather/3日8時(shí)-4日8時(shí)降水量.jpg","href":"http://www.nmc.cn/publish/precipitation/1-7day-precipitation.html","title":"3月3日8時(shí)-3月4日8時(shí)全國(guó)降水量預(yù)報(bào)"}, {"src":"img/weather/4日8時(shí)-5日8時(shí)降水量.jpg","href":"http://www.nmc.cn/publish/precipitation/1-7day-precipitation.html","title":"3月4日8時(shí)-3月5日8時(shí)全國(guó)降水量預(yù)報(bào)"} ] var?num?=index.num; Pic.setAttribute("src",list[num+1].src); Pic.setAttribute("title",list[num+1].title); text.innerHTML?=?list[num+1].title; if(num?==?5){ ??Pic.setAttribute("src",list[0].src); ??Pic.setAttribute("title",list[0].title); ??text.innerHTML?=?list[0].title; ??} } </script> </body> </html>
查看完整描述

2 回答

?
蛋白

TA貢獻(xiàn)3條經(jīng)驗(yàn) 獲得超0個(gè)贊

showPic定義了沒(méi)有調(diào)用,onclick調(diào)用next(),next()中的index沒(méi)有定義,var num = index.num報(bào)錯(cuò),你每次next()調(diào)用也要num++才對(duì).

查看完整回答
反對(duì) 回復(fù) 2016-03-04
?
慕數(shù)據(jù)4485210

TA貢獻(xiàn)3條經(jīng)驗(yàn) 獲得超0個(gè)贊

忽然發(fā)現(xiàn),這樣做的結(jié)果是num只是取到了一個(gè)值,頁(yè)面只會(huì)翻動(dòng)一下。

怎么才能連續(xù)翻動(dòng)刷新num的值呢。。

查看完整回答
反對(duì) 回復(fù) 2016-03-04
  • 2 回答
  • 0 關(guān)注
  • 1685 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)