Skip to content

Instantly share code, notes, and snippets.

@aputinski
Last active December 23, 2015 22:19
Show Gist options
  • Save aputinski/6702362 to your computer and use it in GitHub Desktop.
Save aputinski/6702362 to your computer and use it in GitHub Desktop.
preloadImgSequence = function(params) {
var i, preload, _i, _ref, _results;
preload = function(i) {
var img;
img = document.createElement('img');
return img.src = "/img/" + params.name + "/" + params.name + i + ".png";
};
_results = [];
for (i = _i = 0, _ref = params.frameCount; _i <= _ref; i = _i += 1) {
_results.push(preload(i));
}
return _results;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment