Search code examples
jqueryjquery-masonrymasonry

.imagesLoaded is not a function in masonry


My code is

var ssMasonryFolio = function () {
  var containerBricks = $('.masonry');
  containerBricks.imagesLoaded(function () {
      containerBricks.masonry({
          itemSelector: '.masonry__brick',
          resize: true
      });
  });
};

it gives error on imagesLoaded function

enter image description here


Solution

  • Imagesloaded is actually not a masonry function. It is a separate script, as described here. You need to download it and load it before masonry.