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

Website Redesign Launch: Precon Tanks Gets a Modern Upgrade

We’re excited to announce the launch of the brand-new website for Precon Tanks — a leading manufacturer of precast concrete tanks and systems for the wastewater and stormwater industries. With decades of expertise and a reputation for quality and dependability, Precon needed a website that reflected their technical

The Amazon Dams Network

Proud to present the first online version of the Amazon Dams Network. This has been a project Livewire has been working on for several months with the University of Florida and other members from around the world. This has been a very exciting project and we are pleased

Using Meta Tags In Images

Because search engines mainly rely on the text linked with an image to comprehend its content, using meta tags on images is crucial for SEO. Search engines may more precisely index photos when they are properly tagged, which can increase a website’s visibility and ranking on search engine

african american man using computer

How to Reset the SMC on Your Mac: A Step-by-Step Guide

How to Reset the SMC on Your Mac: A Step-by-Step Guide If your Mac is acting up—battery issues, overheating, or problems with sleep mode—it may be time to reset the System Management Controller (SMC). The SMC controls essential hardware functions like power management, battery charging, and thermal regulation.

Using Red In Website Design

A key component of website design is color, and many designers choose the color red in particular. Red is a passionate, vivid color that may elicit strong feelings and emotions, making it a fantastic choice for designing a strong, compelling website. These are several justifications on why red

Another Mouse Burned

This makes my 7th mouse in less than 18 months. incessant clicking has it’s consequences … and costs …..