0

fiddle - here is example.

I'm trying to do something looking exacly like windows 8 tiles grid. We got 3 types of tile sizes

  • normal=1x1;
  • wide=2x1; and
  • big=2x2.

What my point is is that tiles dont need to be exacly sorted, but there musnt be empty spaces between them.

I've checked Masonry, Isotope, freetile, vGrid, Wookmark and the same problem occurs: empty gaps.

I know that sometimes it may be logically impossible to avoid gaps, but in that case it is possible indeed.

It dont have to be jquery plug-in kind of solution - the only thing I need to get is tiles of different, but fitting to each other sizes and avoid gaps between them when im 'packing' them.

$('article').freetile();
Bruno Vieira
  • 3,884
  • 1
  • 23
  • 35
user1785870
  • 477
  • 1
  • 6
  • 16

2 Answers2

1

Search on SO for Isotope + gaps and Masonry + gaps. Has been dealt with numerous times. Depending on the order of appearance of your 1x1, 2x1 and 2x2 divs in the DOM, at certain browser widths "gaps" are inevitable, especially if your elements are large.

See https://stackoverflow.com/a/11438705/963514 or https://stackoverflow.com/a/12116760/963514

Community
  • 1
  • 1
Systembolaget
  • 2,514
  • 2
  • 21
  • 37
0

I've done it. The point is to set columnWidth. If tiles has 150px and margin 10px between them it would be columnWidth:160.

user1785870
  • 477
  • 1
  • 6
  • 16