desandro / imagesloaded

:camera: JavaScript is all like "You images done yet or what?"
https://imagesloaded.desandro.com
MIT License
8.89k stars 1.15k forks source link

Not working in Firefox #232

Closed packytagliaferro closed 8 years ago

packytagliaferro commented 8 years ago

I am using imagesLoaded.js to wait for images before firing some events. It works great in Chrome and Safari but not in Firefox. Here is the code:

$('#consumer-bg, #page').imagesLoaded({ background: true })

  //Place anything you want to run after images in here
  .done( function( instance ) {

      //remove Preloader
      TweenLite.to($('#preloader'), 1, {autoAlpha: 0 });

      //load menu
      menu(1000);

      //Run home animation 
      homeAnimation(1500);

      //how step animation
      howSteps();

      charitySteps();

   });

If I take my functions out of the .imagesLoaded the site loads fine. When they are in it, the preloader and other functions never fire.

Any ideas??

packytagliaferro commented 8 years ago

I have figure out that it only breaks in firefox when I pass two selectors in (#consumer-bg, #page). If I just use one it works, but I want to check for all the images in #page and the background image in #consumer-bg. When all those are loaded, then fire the functions. Is there another way of doing this??

desandro commented 8 years ago

Sorry to hear you are having trouble with imagesLoaded. Can you please provide a reduce test case. See Submitting issues guidelines