All options available in Masonry are also available in Masonry Ordered, which adds layoutPriorities along them.


layoutPriorities accepts an object consisting of (optional) integer weights for layout strategy.

  itemSelector: '.box',
  columnWidth: 240,
  layoutPriorities: {
    // Masonry default: Try to occupy highest available position.
    // Weight: Pixels of vertical distance from most upper spot.
    upperPosition: 1,
    // Shelf order: Try to display bricks in original order.
    //   (increases ordered-ness, decreases space-efficiency)
    // Weight: Pixels of distance of current brick's top left corner
    //         from previous brick's top right corner.
    shelfOrder: 1

The default settings give 50% weight to placing items in sequence and 50% weight to placing them to highest available position. For original Masonry behavior, set shelfOrder: 0.

jQuery Masonry Ordered by Vit ‘tasuki’ Brunner