Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ability to only load ressources with specified tags #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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