如何使用固定宽度的同位素或砌体?

发布于 2024-11-15 01:13:35 字数 99 浏览 2 评论 0原文

我一直无法找到一种方法来使用同位素(或砌体)与固定宽度的外部容器。

它总是坚持重新调整大小。我浏览了选项、代码、谷歌和这里,但没有找到答案。

有可能吗?

I have not been able to find a way to use Isotope (or Masonry) with a fixed width outer container.

It always insists on re-sizing. I've looked through the options, code, google and here and haven't found the answer.

Is it even possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦在深巷 2024-11-22 01:13:36

你的问题似乎倒退了问题
我正在经历。砌体最适合流体容器,但我想要中心的固定宽度为 980px(主类即:边距:0 auto;宽度 980px;)

然后砌体不起作用

Your question seems backwards to the problem
I was having. Masonry works best with fluid containers but I wanted a fixed width of 980px on my center (main class ie: margin:0 auto; width 980px; )

Then masonry doesn't work????... The fix is to find the center or whatever class u use to contain all content to a set width and change it from width to max-width:980px. This means ur still on fixed width centered container but masonry items will readjust / relayout upon resizing the browser.

I have a module I'm working on at www.digi2020.com - choose menu -> portfolio and u will see that does just this. I've added a lot of bells and whistles but a simple call to masonry will achieve same effect.

Inspect and Check out the .main class and the JavaScript on that page.

Another example using isotope on a fixed width that does not allow items to relayout on resize but still provides filtering can be found on pressedweb.com/portfolio

你与昨日 2024-11-22 01:13:36

通常,当您将外部容器设置为 max-width 时,就会发生这种情况。我使用了 width:960px 并且在调整浏览器窗口大小后它不会干扰砖石网格。也许检查所有您的外容器?

Usually this happens when you set the outer container to max-width. I have used width:960px and it does not interfere with the masonry grid after resizing the browser window. Maybe check all of your outer containers?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文