Team:Buenos Aires/Pruebas
From 2013.igem.org
(Difference between revisions)
Line 337: | Line 337: | ||
}); | }); | ||
}, | }, | ||
- | + | /* preloads a set of images */ | |
+ | loadImages = function() { | ||
+ | return $.Deferred( | ||
+ | function(dfd) { | ||
+ | var total_images = $ItemImages.length, | ||
+ | loaded = 0; | ||
+ | for(var i = 0; i < total_images; ++i){ | ||
+ | $('<img/>').load(function() { | ||
+ | ++loaded; | ||
+ | if(loaded === total_images) | ||
+ | dfd.resolve(); | ||
+ | }).attr('src' , $ItemImages[i]); | ||
+ | } | ||
+ | } | ||
+ | ).promise(); | ||
+ | }; | ||
return { | return { |
Revision as of 00:25, 27 May 2013