kombai / freewall

Freewall is a cross-browser and responsive jQuery plugin to help you create grid, image and masonry layouts for desktop, mobile, and tablet...
MIT License
1.85k stars 375 forks source link

How to avoid holes #169

Open rubenjimenez opened 9 years ago

rubenjimenez commented 9 years ago

Hi,

I'm using Freewall in a project and i'm happy with it, but usually i get empty spaces and i'd like to avoid that behavior.

I've seen there is a method called fillHoles which I guess i could use, but i don't know how.

          jQuery($element).html($compile(html)($scope));

          var wall = new freewall($element);
          wall.reset({
            selector: '.article-gallery-image',
            animate: true,
            cellW: 20,
            cellH: 200,
            onResize: function() {
              wall.fitWidth();
            },
            onGapFound: function () {
              console.log('GAP!');
            }
          });

          wall.fitWidth();

          jQuery(window).trigger('resize');

As you can see, I've used onGapFound event as well but i don't get anything when an empty space shows up.

How could i avoid those annoying empty spaces? I'd like to get all the available space in a div container filled with the divs I pass to Freewall.

I attach an example of what i'm explaining.

freewall-gap

Thanks in advance!

cfmaniac commented 8 years ago

There's a Method called fillHoles(). new Freewall("#Freewall").fitWidth().fillHoles();