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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

不用promise 直接JS 寫的 不能用瀏覽器直接打開嗎 為什么我的球不動(dòng)

JS寫的那部分 不能直接瀏覽器打開嗎 ?為什么我的不動(dòng) 按照老師寫 ? 沒有用 什么open 命令行 ?我是window系統(tǒng) ? 直接瀏覽器打開

正在回答

5 回答

我用不用promise的寫法 只用js寫的 也是球不動(dòng) 報(bào)錯(cuò)是這個(gè)?var marginLeft = parseInt(ball.style.marginLeft,10) 但是不知道這個(gè)怎么錯(cuò)的

0 回復(fù) 有任何疑惑可以回復(fù)我~

第 17 行:ball,style.marginLeft = marginLeft +'px'; 就是一個(gè)標(biāo)點(diǎn)符號(hào)的錯(cuò)誤,ball后面的逗號(hào),大哥,你手誤了

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

qq_懂我不言i_1

棒棒噠
2018-08-14 回復(fù) 有任何疑惑可以回復(fù)我~
  1. 第四行 ?function animate(ball,distance,cb){...}里的ball,distance,cb三個(gè)參數(shù)去掉。

  2. 第八行 ?cb && cb() 換成 resolve()

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

初影_chaos

promise的用法
2017-12-28 回復(fù) 有任何疑惑可以回復(fù)我~

if(marginLeft === distance){

cb && cb()

}

你那里寫的三個(gè)等號(hào)

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

初影_chaos

不是這個(gè)的原因
2017-12-28 回復(fù) 有任何疑惑可以回復(fù)我~

var ball1 =document.querySelector('.ball1')

var ball2 =document.querySelector('.ball2')

var ball3 =document.querySelector('.ball3')

function animate(ball,distance,cb){

setTimeout(function(){

var marginLeft = parseInt(ball.style.marginLeft,10)

if(marginLeft === distance){

cb && cb()

}

else{

if(marginLeft < distance) {

marginLeft++

}

else{

marginLeft--

}

ball,style.marginLeft = marginLeft +'px';

animate(ball,distance,cb)

}

},13)

}


animate(ball1,100,function(){

animate(ball2,200,function(){

animate(ball3,300,function(){

animate(ball3,150,function(){

animate(ball2,150,function(){

animate(ball1,150,function(){

//

})

})

})

})

})

})


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
進(jìn)擊Node.js基礎(chǔ)(二)
  • 參與學(xué)習(xí)       76728    人
  • 解答問題       242    個(gè)

本教程帶你攻破 Nodejs,讓 JavaScript流暢運(yùn)行在服務(wù)器端

進(jìn)入課程

不用promise 直接JS 寫的 不能用瀏覽器直接打開嗎 為什么我的球不動(dòng)

我要回答 關(guān)注問題
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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