A
Andrew Poulos
I realise that this probably gets answered before but, alas, google has
let me down.
var myimg, len = 10; // say
for (var i = 0; i < len; i++) {
myimg = ... // code that dynamically adds an image
myimg.onload = function() {
// do stuff here
};
}
Of course 'do stuff here' only occurs on the last iteration. How do I
get the onload triggering for every image created by the loop?
Andrew Poulos
let me down.
var myimg, len = 10; // say
for (var i = 0; i < len; i++) {
myimg = ... // code that dynamically adds an image
myimg.onload = function() {
// do stuff here
};
}
Of course 'do stuff here' only occurs on the last iteration. How do I
get the onload triggering for every image created by the loop?
Andrew Poulos