I like you. I think you’re cool. Thank you for reading my Blog. It’s getting better the more I write. But anyway, enough about us. Let’s talk about how you’re going to use my Image Preloader script. It’s free, do whatever you want with it. Call it your own, whatever, I don’t really care. I like FREE knowledge. I love to compete. I love it when I’ve worked so hard that I can’t think anymore. Call me crazy, but at least call me because I can make you wealthy: 801-787-3237.
I digress.
I wanted to share with you all a way to preload your images with jQuery. If you don’t know what jQuery is, you’re living in the stone age of the web. jQuery makes the average developer look like a Rockstar. I’m not even kidding. Please, read up on jQuery. I’m a firm believer that no site should be built without jQuery at its core.
Now, here’s how you can make yourself an image preloader with jQuery, or well, it’s how you preload your images with jQuery. Okay? We on the same page here?
The code:
1 2 3 4 5
| jQuery.preload_images = function() {
for(var i = 0; i < arguments.length; i++) {
jQuery("<img>").attr("src", arguments[i]);
}
}; |
CONTINUE READING