Skip to content

Instantly share code, notes, and snippets.

@sthembi
Forked from eliperelman/LICENSE.txt
Created November 24, 2012 09:03
Show Gist options
  • Save sthembi/4138951 to your computer and use it in GitHub Desktop.
Save sthembi/4138951 to your computer and use it in GitHub Desktop.
Preloader140

Preloader140

A tweet-sized JavaScript Image Preloader.

To use:

var preload = function(a,b){a=[].slice.call(arguments),b=a.length;for(;b--;){Image().src=a[b]}};

preload('http://www.google.com/images/logos/ps_logo2.png', 'http://localhost:8080/images/myimage.png', 'image1.jpg');
function (a,b) {
a = [].slice.call(arguments), // make an array of all the passed in string URLs
b = a.length; // cache the length of the array
for (; b--;) { // iterate over the array
Image().src = a[b] // create a new image for each URL
}
};
function(a,b){a=[].slice.call(arguments),b=a.length;for(;b--;){Image().src=a[b]}};
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
{
"name": "Preloader140",
"description": "JavaScript Image Preloader based on 140byt.es rules.",
"keywords": [
"140bytes",
"master",
"image",
"preloader",
"javascript"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment