我想从下往上堆叠我的砌体砖。
这个问题之前已经回答过,但是 Masonry 的修改和分支现在使用了非常旧的脚本版本。新版本的 Masonry 修复了我需要的错误。
那么有谁知道如何将旧的解决方案应用到新的脚本中?
var position = (opts.fromBottom) ? {
left: props.colW * shortCol + props.posLeft,
bottom: minimumY
} : {
left: props.colW * shortCol + props.posLeft,
top: minimumY
};
这是一个Fiddle with the newer Masonry script 。我在第 74 行添加了 fromBottom 选项。有问题的代码位于第 285 行左右。
这个问题在最新版本的 Masonry 中已过时(现在是标准选项)。
最佳答案
替换它(从第 287 行开始):
var position = {
top: minimumY + this.offset.y
};
这样:
var position = (this.options.fromBottom) ? {
bottom: minimumY + this.offset.y
} : {
top: minimumY + this.offset.y
};
关于jquery - 自下而上的砌体堆叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14539368/