How do I wait to execute my code until all of my images are loaded in pure javascript

前端 未结 0 470
一整个雨季
一整个雨季 2021-01-26 00:36

my code is

  var stone = new Image(20, 20);

  var grass = new Image(20, 20);

  var dirt = new Image(20, 20);
  
  stone.id = \'stone\' ;
  stone.src = \'stone.p         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题