Home » Jquery » Preloading Images with Jquery

Preloading Images with Jquery

There are times when preloading images is an important step in keeping your site/page/program running smoothly. This is especially true in the era of mobile.

Here’s a cute little snippet that does just that.

function preload(yourarrayOfImages) {
    $(yourarrayOfImages).each(function(){
        $('<img/>')[0].src = this;
    });
}

preload([
    'img/image1.jpg',
    'img/image2.jpg',
    'img/image3.jpg'
]);

 

More Web Design Blog Content

Garry Seay has a New Website

Garry is running for Sheriff in Union county Florida. We wish him the best of luck and he has a great new website to show off. His campaigners came to me after locating Livewire on Google. We met and discussed their needs. They needed something up and running

Review: WordPress Business Directory ★ ★ ★

[vc_row][vc_column width=”1/3″][vc_button title=”Where it’s at” target=”_blank” color=”btn-inverse” icon=”wpb_arrow” size=”wpb_regularsize” href=”http://codecanyon.net/item/wp-business-directory/2203258″][vc_column_text] ★ ★ ★ Features V1.8 Premium Membership (Paypal) Location Based Search Internationalization CSV Import with auto map location finder[/vc_column_text][/vc_column][vc_column width=”1/3″][vc_column_text] 3 Stars out of 5 This is a wordpress plugin We took off one point for poor style

web design ocala fl

Why Local Web Design Matters for Your Ocala Business

In today’s digital age, having a professional website isn’t just an option—it’s a necessity. But not all websites are created equal, especially when it comes to local businesses. If your business is based in Ocala, FL, choosing a local web design company like Livewire can make all the

What is in a name? SEO strategies for Facebook

Establishing Connections. Social media represents a critical marketing opportunity for small business in creating connections with potential clients through shares and referrals. There are certain marketing and SEO strategies that standout in creating value for your business. We all have that friend that excusably shares information just to

Preloading Images with Jquery

There are times when preloading images is an important step in keeping your site/page/program running smoothly. This is especially true in the era of mobile. Here’s a cute little snippet that does just that. function preload(yourarrayOfImages) { $(yourarrayOfImages).each(function(){ $(‘<img/>’)[0].src = this; }); } preload([ ‘img/image1.jpg’, ‘img/image2.jpg’, ‘img/image3.jpg’ ]);

Maintaining Correct Site Structure

One of the biggest holes in a client’s SEO (pre livewire SEO, that is) is almost always the site structure. So many SEO companies focus on content and backlinks that quality code is often overlooked. There are many cases where we have come into the tail end of