看板 [ Ajax ]
討論串[問題] 延後執行的問題
共 4 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者s25g5d4 (function(){})()時間10年前 (2015/08/22 11:27), 10年前編輯資訊
0
1
1
內容預覽:
前陣子因為試用 Visual Studio Code 與 Electron 寫了一個小專案. 剛好寫到跟你問題一模一樣的東西,code 在此. https://github.com/s25g5d4/SlideShow/blob/master/scripts/main.js#L76. 我使用 mrbi
(還有2549個字)

推噓1(1推 0噓 2→)留言3則,0人參與, 最新作者mrbigmouth (大嘴先生)時間10年前 (2015/08/22 07:56), 編輯資訊
0
0
0
內容預覽:
無任何套件的情況下可以用setTimeout檢查. function checkAndDoSomething() {. if (array.length === m.length) {. //do some thing. }. else {. setTimeout(checkAndDoSomethi
(還有68個字)

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者dianwu (dian)時間10年前 (2015/08/22 05:06), 編輯資訊
0
0
0
內容預覽:
我會這樣改var imgReady =0; imgReady++;. if (imgReady === m.length) dosomthing(array);然後不建議在迴圈中直接宣告 function 因為 scope 容易混亂。應該是引用外部 function 比較好. --. Sent fr

推噓3(3推 0噓 2→)留言5則,0人參與, 最新作者m2251000 (akakaze 二兵 >)時間10年前 (2015/08/22 04:45), 編輯資訊
0
0
0
內容預覽:
一個小程式,還請大大們看一下程式碼. var array = [];. for (n in m) {. var img = new Image();. var i = m[n];. img.onload = function () {. //圖片讀取好後進行一些處理再return回來. var t
(還有334個字)
首頁
上一頁
1
下一頁
尾頁