5

HI i am making my project using Isotope.js where i have to show my tiles in the horizontal manner, So i am following 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 unluckily it is not working , error on the console is

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

Help is appreciable must

Jot Dhaliwal
  • 1,470
  • 4
  • 26
  • 47

2 Answers2

5

You're not including the isotope plugin on your page.

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


This is grabbed from your site. If you uncomment that line, you should be good.

<!--<script type="text/javascript" src="js/jquery.isotope.min.js"></script>-->
cowcowmoomoo
  • 507
  • 2
  • 10
2

I'm having the same problem and found something. The jquery-isotope never sets window.Isotope.LayoutMode. That's why it is undefined. If you don't use the jquery and just the regular one, you should not have this problem.

I fixed it by include the layout-mode.js right after jquery.isotope.js, and just before the masonry-horizontal.js

Wim
  • 41
  • 3