user2599347
user2599347

Reputation: 91

masonry js error: Uncaught TypeError: Object [object Object] has no method 'imagesLoaded'

When I try to use masonry js I get this error:

Uncaught TypeError: Object [object Object] has no method 'imagesLoaded'

I'm loading this scripts:

.jquery 1.10.2 .twitter bootstrap 2.3.2 .masonry 3.0.3

the scripts are loaded in that order and they load ok, I've checked.

I also tried removing the bootstrap js, but the error persisted.

the javascript that initializes masonry:

$(function(){
var $container = $('#container');

$container.imagesLoaded( function(){
  $container.masonry({
    itemSelector : '.masonryImage'
  });
});
});

Upvotes: 2

Views: 6436

Answers (1)

Hushme
Hushme

Reputation: 3144

try using

    $(function(){
var $container = $('#container');


  $container.masonry({
    itemSelector : '.masonryImage'
  });

});

because imgloaded script file is not attachted yo ur html file if you want to use that file download it from here

Upvotes: 1

Related Questions