Checking for multiple images loaded

后端 未结 7 2204
死守一世寂寞
死守一世寂寞 2021-02-20 09:26

I\'m using the canvas feature of html5. I\'ve got some images to draw on the canvas and I need to check that they have all loaded before I can use them.

I have declared

7条回答
  •  时光取名叫无心
    2021-02-20 10:01

    A hackish way to do it is add the JS command in another file and place it in the footer. This way it loads last.

    However, using jQuery(document).ready also works better than the native window.onload.

    You are using Chrome aren't you?

提交回复
热议问题