jQuery Masonry
09 декабря 2009
Каждй раз, когда вижу очередную такую библиотеку, подмывает переложить всю заботу о модульной сетке проекта на нее (англ.).
А, впрочем, посмотрите, что можно сделать при ее помощи буквально в несколько строчек кода:
('#wrapper').masonry({ singleMode: false, // Disables measuring the width of each floated element. // Set to true if floated elements have the same width. // default: false columnWidth: 240, // Width in pixels of 1 column of your grid. // default: outer width of the first floated element. itemSelector: '.box:visible', // Additional selector to specify which elements inside // the wrapping element will be rearranged. resizeable: true, // Binds a Masonry call to window resizes. // default: true appendedContent: $('.new_content'), // Additional container element for appended content. // Useful for Infinite Scroll integration. saveOptions: true, // Masonry will use the options from previous Masonry // calls by default, so you only have to enter in options once // default: true }, function() {} // Optional callback. // 'this' will refer to the applicable elements Masonry just rearranged );