Skip to content

coreindustries/SimpleQueue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleQueue v.1

SimpleQueue is a jquery-based javascript image loading queue that allows you to control the order in which images are loaded. Images in the queue are loaded sequentially instead of in parallel. Why would you want to do this? Let's say that some images are more important than others... perhaps in a carousel or above the fold. In other words, you might want some images to appear as fast as possible while others can be loaded when the user's bandwidth permits.

works with FF, Safari, Chrome, IE6, IE7, IE8

One of the tricky bits of building an image queue, is successfully watching when each image is loaded. On many browsers, the .load event doesn't fire reliably when the image is in cache. In our case, we instantiate an Image() object, add the .load method, and then start loading the file. This reliably catches the load even on nearly all browsers (including IE6).


@author Corey Szopinski | [email protected]

USAGE:
var q1 = new SimpleQueue();
q1.add('bigimage.jpg', 'alt image attribue', $('#div'));
q1.add('bigimage2.jpg', 'alt image attribue', $('#div'));
q1.start();


CALLBACK:
handleQueueFinished()  - fired when queue is complete

Multiple queues can run on the same page, either in parallel or sequentially


references: http://jqueryfordesigners.com/image-loading/

About

A simple jquery-based image loading queue

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published