色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

如何用Javascript進(jìn)行異步倒計(jì)時(shí)?

吉茹定1年前8瀏覽0評論

所以我試著從30倒數(shù)到0,我等待3.75秒,因?yàn)槲蚁朐谀侵笞鲆粋€(gè)氧吧

函數(shù)air()應(yīng)該是誰在倒計(jì)時(shí)

async function air(){
    var timer;
    var barre_oxygene = 6;
    var ele = plateau[14][5]
    timer = setInterval(()=>{
        ele.innerHTML = 30 - 1;
    }, 1000)
}

2d數(shù)組的初始化:

function initPlateau() {
  plateau = new Array(hauteur);
  for (let i = 0; i < hauteur; i++) {
    plateau[i] = new Array(largeur);
  }
  let contenu = document.querySelector("#contenu");
  let monTableau = document.createElement("table");
  // lignes 
  for (let i = 0; i < hauteur; i++) {
    let uneLigne = document.createElement("tr");
    for (let j = 0; j < largeur; j++) {
      let uneColonne = document.createElement("td");
      uneLigne.appendChild(uneColonne);
      uneColonne.style.backgroundSize = "contain";
      plateau[i][j] = uneColonne;
    }
    monTableau.appendChild(uneLigne);
  }
  contenu.appendChild(monTableau);

  // Set dynamic background image size based on largeur and hauteur
  contenu.style.backgroundImage = "url('./img/header.png'), url('./img/footer.png'), url('./img/middle-image.png')";
  contenu.style.backgroundRepeat = "no-repeat";
  contenu.style.backgroundPosition = "top center, bottom center, top center";
  contenu.style.backgroundColor = "blue";
  contenu.style.backgroundSize = `${largeur * 45}px ${hauteur * 9.5}px`;
}

當(dāng)我開始整個(gè)程序(有200個(gè)ligns)時(shí),倒計(jì)時(shí)沒有顯示(我需要他彈出第14行第5列。 我有錯(cuò)誤& quot無法讀取未定義的屬性(讀取“5”)

我試著用變量來代替5