I have a simple code:
<div id="dk" style="background-image: url('d.jpg');"></div>
I would like to monitory this div loading and when it success do something and if the load take more then 5 seconds do otherthing.
I was trying to do :
document.getElementById('dk').addEventListener('loadeddata', function () {
//do something
}, false);
But i belive that it works just for vídeos and áudios. Otherhand it will get just when it is complete.