Search code examples
javascriptjquery-isotopepackery

isotope metafizzy and packery version?


i have a problem with the version from isotope metafizzy packery:

here is the js-version v1.1.0 = http://isotope.metafizzy.co/layout-modes/packery.html

and here is the js-version v1.3.2 = http://packery.metafizzy.co/

but my code works only with this v1.1.0 code:

jQuery(document).ready(function ()
{

    // isotope in bootstrap tabs
    $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
        $container = jQuery('#teaserIsotope');

        // Fire Isotope only when images are loaded
        $container.imagesLoaded(function(){
            // init Isotope
            $container.fadeIn(600).isotope({
                //resizable: true,
                itemSelector: '.item',
                layoutMode: 'packery',
                packery: {
                    columnWidth: '.grid-sizer',
                    gutter: '.gutter-sizer'
                }
            });
        });
    });

    // isotope in content
    $container = jQuery('#teaserIsotope');

    // Fire Isotope only when images are loaded
    $container.imagesLoaded(function(){
        // init Isotope
        $container.fadeIn(600).isotope({
            //resizable: true,
            itemSelector: '.item',
            layoutMode: 'packery',
            packery: {
                columnWidth: '.grid-sizer',
                gutter: '.gutter-sizer'
            }
        });
    });
});

how can i update the js code ? thanks


Solution

  • You are confused about the layout mode called "packery" for the javascript library isotope vs the separate javascript library that is called packery. They are different and not interchangeable in your code.

    What you are using in your code is the "layout mode" for isotope, called packery v1.1.0 Packery layout mode js. You need to use this layout mode with Isotope v2, not with Packery v1.3.2