terrymun/Fluidbox

imageloaddone.fluidbox doesn't fire

Closed this issue · 3 comments

Hi,

with version 1.4.3 i successfully use folllowing code to show an (animated) indicator (only) while loading the target image source:

// fluidbox v.1.4.3

$('a[rel="fluidbox"]').fluidbox({
  immediateOpen: true})
.on('openstart', function() { 
  $(this).find(".fluidbox-ghost")
  .append("<div class='is-loading-fluidbox'><div class='progress progress--large'></div></div>");
})
.on('imageloaddone', function() { 
    $(this).find('.is-loading-fluidbox').remove();
});

With the last stable version 2.0.4 there are some changes how to call the events and naming, but the custom event imageloaddone.fluidbox seems to be still available though. Unfortunately the imageloaddone.fluidbox doesn't get triggered in the code shown below (while openend.fluidbox does, for example).

// fluidbox v.2.0.4

$('a[rel="fluidbox"]').fluidbox({
  immediateOpen: true})
.on('openstart.fluidbox', function() { 
  $(this).find(".fluidbox__ghost")
  .append("<div class='is-loading-fluidbox'><div class='progress progress--large'></div></div>");
})
.on('imageloaddone.fluidbox', function() { 
    $(this).find('.is-loading-fluidbox').remove();
});

Do i miss something? Any hints are highly appreciated! Thanks.

I can see that at some point the imageloaddone event trigger is removed from the source. I will add it back it and do some unit tests, before releasing a fix. Thanks for highlighting it.

Great! Thanks a lot.

This is now fixed in 1beb60c :)