2

In pinterest.com, the divs have variable length, yet there are no gaps between the rows. Is it possible to get this effect using an unordered list and css? Are they using any javascript to achieve that "compact" look? When I tried it, there is always a gap between two rows to accommodate the tallest div from the first row...

Diodeus - James MacFarlane
  • 110,221
  • 32
  • 151
  • 174
Prabhu
  • 12,447
  • 32
  • 123
  • 203

3 Answers3

4

If you use Firebug or Chrome's web inspector, you'll see that each of the .pin divs has an absolute position, which is presumably set with JavaScript.

David Wolever
  • 139,281
  • 83
  • 327
  • 490
4

It's done via jQuery Masonry available on github https://github.com/desandro/masonry

Francis Ouellet
  • 505
  • 4
  • 15
1

There's a lot of jQuery Plugins that archive that.

I like "Isotope - An exquisite jQuery plugin for magical layouts"

http://isotope.metafizzy.co/