如何使用 javascript 编写复杂的图像网格
对于作品集网站,我必须开发一个视觉图像网格。
我现在正在对这个网格进行测试。
我有两种选择:
1.一个简单的网格,具有垂直对齐,就像这个线框上的一个:http://daviddarx.com/stuffs/work/barbu/wireframe/search/simple.png
有几个插件可以做到这一点,我可以轻松开发一个习惯解决方案(如有必要)。但这个网格有点过于简单和常见了。我希望得到一个更复杂的网格,如下所示:
2.一个复杂的网格,没有任何垂直或水平对齐,就像这个线框上的那样: http://daviddarx.com/stuffs/work/barbu/wireframe/search /complexe.png
但对于这个,我真的不知道如何从概念上开始开发它。
所以这是我的问题:
-我很想开发一个自定义网格,以获得我想要的东西。对于如何开发这样的网格,您有什么建议、策略、教程吗?哪些步骤,如何启动等等...-
如果有的话,你知道有什么插件或库可以实现这一点吗?
预先感谢您的帮助! 大卫
For a portfolio website, I'll have to develop a visual grid of images.
I am now doing tests for this grid.
I have two alternatives:
1.A simple grid, with vertical alignments, like the one on this wireframe: http://daviddarx.com/stuffs/work/barbu/wireframe/search/simple.png
There is several plugins to do that, and I could easily develop a custom solution, if necessary. But this grid is a bit too simple and common. I would love to get a more complexe grid like this one:
2.A complexe grid, without any vertical or horizontal alignment, like the one on this wireframe:
http://daviddarx.com/stuffs/work/barbu/wireframe/search/complexe.png
But for this one, I really don't see how to start to develop it, conceptually.
So here are my questions:
-I would love to develop a custom grid, to get exactly what I want. Do you have any advices, strategies, tutorials about how to develop such a grid? Which steps, how to start it, etc...
-If else, do you know any plugin or library which could achieve that?
Thank you in advance for your help!
David
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个 jQuery 插件可能会做你想做的事: http://isotope.metafizzy.co/
如果没有这样做,请解释原因,我会尝试看看是否可以想出不同的解决方案。
This jQuery plugin might do what you want: http://isotope.metafizzy.co/
If that doesn't do it, please explain why and I'll try to see if I can think of a different solution.
您可以使用 jQuery 插件 masonry。如果你想自己做,你可以使用树形图算法,但也有一个 jQuery 插件树形图。
You can use the jQuery plugin masonry. If you want to do it yourself you can use a treemap algorithm but there is also a jQuery plugin treemap.