Home

Awesome

jQuery.Preload

Description

This is an advanced multi-functional preloader, that has 4 modes integrated. Each mode suits a different, common situation.

Demo

You can see the demo at http://demos.flesler.com/jquery/preload/

Installation

The plugin requires jQuery 1.8 or higher and jquery.scrollTo.

Via bower:

bower install jquery.preload

Via npm:

npm install jquery.preload

Manually: You can download the latest stable version from the releases page.

Modes / Settings

The modes are:

Since 1.0.6, you can combine these 2 modes, for another common use. If you have many images in a page, you might want to load a lighter version of them first, and then sequentially load and replace the real images. To achieve this, use the light versions in the html, then preload the heavy ones as if they were rollover images(find+replace). If you set 'placeholder' to true, each preloaded image will be set instead once it loads. There's also a threshold setting, that determines how many images are preloaded simultaneously, it is 1 by default.

Callbacks

The plugin also provides 3 callbacks to interact with the image URLs during the preloading process. The callbacks get a hash of data, with details of the related image and global information. The callbacks are:

Data received by callbacks

The hash of data received by the callbacks, contains the following information:

Note that threshold and the callbacks, are not related to any mode, and can be useful for any of them.