i\'d like to show a progress bar while i update the app with fresh content. I guess the best thing to do would be to do it while calling .fetch on a collection.
The cont
Here's some steps that might work out.
imagesurls
. (this will be an array of strings).imagesleft
.var imageOnLoad = function () {...}
capturing that variable which
imagesleft
by 1imagesleft
reaches 0, invoke the code/method to cause the popover to eventually go awayimagesurls[i]
in the imagesurls
array
var img = new Image();
img.onload = imageOnLoad;
img.src = imagesurls[i];
Of course I'm ignoring error situations (Images have an onerror
property you could assign similarly and the original ajax could fail). but I think the gist of a solution is there. The only thing I'm wondering about is whether or not you actually need to keep a reference to each of the images objects as they're being created. It might be a good idea, at least until you are done with the whole image set. Otherwise, I'd have to worry about garbage collection somehow interfering in some implementation... but then maybe I'm just being paranoid.