V
V
valackar2016-04-20 11:18:15
JavaScript
valackar, 2016-04-20 11:18:15

ImagesLoaded is not a function why?

Uncaught TypeError: $container.imagesLoaded is not a function

I'm trying to connect Masonry, I'm doing the lessons, all the paths are correct, but the console gives an error. I don't understand why

js

<script type="text/javascript" src="/assets/templates/site/adaptiv/libs/imagesloaded/imagesloaded.pkgd.min.js"></script>
  <script type="text/javascript" src="/assets/templates/site/adaptiv/libs/imagefill/jquery-imagefill.js"></script>
  <script type="text/javascript" src="/assets/templates/site/adaptiv/libs/masonry/masonry.pkgd.min.js"></script>
<script type="text/javascript">
  $(window).load(function(){ 
var $container = $(".masonry-container");
  $container.imagesLoaded(function () {
    $container.masonry({
      columnWidth: ".item",
    itemSelector: ".item"
  });
});
  });
</script>

HTML
<div id="container" class="masonry-container">
<div class="item">
      <img  src="/assets/galleries/102/11.jpg" alt=""> 
    </div>
<div class="item">
      <img src="/assets/galleries/102/1.jpg" alt=""> 
    </div>
</div>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
valackar, 2016-04-20
@valackar

In general, I solved the problem. it turned out there were glitches in other scripts because of this and gave an error

S
SergeiRybkin, 2020-10-17
@SergeiRybkin

imagesLoaded now needs to be loaded separately: imagesloaded.desandro.com

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question