Skip to content

Conversation

@timohausmann
Copy link

Hey.
I added the following functionality:

It is now possible to load ressources in groups, defined by tags. Each group can have an own completionListener.
An example: you want to load a group of ressources on document ready. Later, when the user performs a specific action, you want to preload other ressources and treat them differently when loading is complete.

All you have to do is pass true as a second argument to the start-function (specifiedTagsOnly).

A quick demo: http://jsbin.com/ugojeb/2/

loader.addImage( 'http://placekitten.com/200/300', 'initial' );
loader.addImage( 'http://placekitten.com/200/300', 'content' );

loader.addCompletionListener(function() {
    [...]
}, 'initial');
loader.addCompletionListener(function() {
    [...]
}, 'content');

loader.start('initial', true);
$('button').on('click', function() {
  loader.start('content', true);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant