9

I'd like to stack my Masonry bricks from the bottom up.

This question was answered before, but that modification and fork of Masonry use a very old version of the script now. The newer version of Masonry has bug fixes which I needed.

So does anyone know how to apply the old solution to the newer script?

Here is the old solution.

var position = (opts.fromBottom) ? {
  left: props.colW * shortCol + props.posLeft,
  bottom: minimumY
} : {
  left: props.colW * shortCol + props.posLeft,
  top: minimumY
};

Here is a Fiddle with the newer Masonry script. I added fromBottom option at line 74. The code in question is around line 285.

This question is obsolete in the newest version of Masonry (now a standard option).

Community
  • 1
  • 1
Jennifer Michelle
  • 1,493
  • 1
  • 15
  • 33

2 Answers2

9

Replace this (starting at line 287):

var position = {
  top: minimumY + this.offset.y
};

with this:

var position = (this.options.fromBottom) ? {
  bottom: minimumY + this.offset.y
} : {
  top: minimumY + this.offset.y
};

Demo

Jeffery To
  • 11,548
  • 1
  • 25
  • 41
0

When using stack-bond it is very important to let the masonry dry before you apply a new layer. So, best is to stack line-by-line and not first up and then to the side, so you can always control the level of the total stack. Interleaving stack bond with a layer of running bond now and then is good practice and decorative too.

arjan
  • 9
  • 1