Skip to content

Instantly share code, notes, and snippets.

@tivac
Created January 6, 2010 22:59
Show Gist options
  • Save tivac/270774 to your computer and use it in GitHub Desktop.
Save tivac/270774 to your computer and use it in GitHub Desktop.
Y.all(this.selector).each(function(n) {
if(!this._imageLoaded(n)) {
n.on('load', _setup, this);
}
_setup(n);
}, this);
_setup : function(img) {
},
_imageLoaded : function(img) {
if (img) {
var w = img.get(NATURAL_WIDTH);
return img.get(COMPLETE) && (!isNumber(w) ? img.get(WIDTH) : w);
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment