Skip to content

Instantly share code, notes, and snippets.

Avatar

Yuki Sekiguchi redamoon

View GitHub Profile
@tirams
tirams / preloadImages
Created Feb 15, 2012
jQuery plugin to preload images
View preloadImages
// Usage: $(['img1.jpg','img2.jpg']).preloadImages(function(){ ... });
// Callback function gets called after all images are preloaded
$.fn.preloadImages = function (callback)
{
// Helper function, used below.
// Usage: ['img1.jpg','img2.jpg'].remove('img1.jpg');
var checklist = this.toArray();
var removeImg = function (element)
{