Uncaught TypeError: Unable to read LayoutMode property from undefined

Hi, I am doing my project using Isotope.js where I have to show my tiles horizontally, so I follow the code

var winDow = $(window);
    // Needed variables
    var $container=$('.portfolio-box, .blog-box');
    var $filter=$('.filter');

    try{
        $container.imagesLoaded( function(){
            $container.show();
            $container.isotope({
                layoutMode: 'masonryHorizontal',
                masonryHorizontal: {
                    rowHeight: 50
                },

            });
        });
    } catch(err) {
    }

but, unfortunately, it does not work, an error on the console

1.    Uncaught TypeError: Cannot read property 'LayoutMode' of undefined
2.    Uncaught TypeError: undefined is not a function

Help is noticeable.

+4
source share
2 answers

You do not include the isotope plugin on your page.

You need to include both isotope.pkgd.min.js, and somasonry-horizontal.js


This is grabbed from your site. If you uncomment this line, you should be kind.

<!--<script type="text/javascript" src="js/jquery.isotope.min.js"></script>-->
+5
source

- . JQuery- window.Isotope.LayoutMode. undefined. jquery , .

layout-mode.js jquery.isotope.js masonry-horizontal.js

+2

Source: https://habr.com/ru/post/1541256/


All Articles