Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Masonry stack from bottom up

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).

like image 385
Jennifer Michelle Avatar asked Jan 26 '13 17:01

Jennifer Michelle


1 Answers

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

like image 103
Jeffery To Avatar answered Nov 12 '22 00:11

Jeffery To