jquery isotope plugin container height will not grow with isotope-item (same with masonry)
Asked Answered
L

5

6

I have an isotope-item that will grow in height when somebody comments inside of it. When it grows, how do I tell the main isotope container to grow with it? Right now what is happening is, as the isotope-item grows, the isotope container maintains it's initial height that was set when calling $(".home_main").isotope(); So when I leave comments inside the isotope-item, the item grows, then is cut off by the main container. Thanks.

I have seen that you can set resizesContainer: true but this hasn't helped me. Thanks.

Not sure if it makes any difference but I have also tried this with the Masonry jquery plugin as well (seems pretty similar) and had the same problem.

Leisaleiser answered 28/9, 2012 at 22:55 Comment(0)
L
9

Found the answer here:

https://github.com/desandro/isotope/issues/275

You have to call relayout like this:

$("#your_container").isotope( 'reLayout' )
Leisaleiser answered 28/9, 2012 at 23:16 Comment(0)
C
5

In Isotope V2 the syntax is

$("#your_container").isotope('layout')
Crop answered 23/8, 2014 at 10:36 Comment(0)
R
1

In Isotope PACKAGED v2.2.2, you can also 're-arrange / re-layout' your container:

    $(window).scroll(function(){
        $container.isotope( 'layout' );
    }
Repulse answered 7/4, 2016 at 21:4 Comment(0)
C
1

In Isotope V3

$(window).on('load', function(){
    var $container = $('#your_container');
    $container.isotope({
        itemSelector: '.item'
    });
});
Crude answered 11/9, 2019 at 13:6 Comment(0)
R
0

If your using the latest isotope, (not specified version but you can see the date of this comment) read the first link and include the appropriate couple of lines and include the library from the second link.

http://isotope.metafizzy.co/appendix.html

http://imagesloaded.desandro.com/

Rossman answered 26/8, 2014 at 19:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.