1 2 3 4 5 6 7 8 9 10 11 12 |
/** * @function Determine if the image has been loaded. * @param img,callback */ function imgIsLoaded(img, callback) { var timer = setInterval(function () { if (img.complete) { callback(img) clearInterval(timer) } }, 50) } |