[英]How can I display images of different sizes in this way? And is there jquery plugins to do that
How can I display images of different sizes in this way?如何以这种方式显示不同尺寸的图像? And is there jquery plugins to do that?
是否有 jquery 插件可以做到这一点?
https://i.stack.imgur.com/ELll7.png https://i.stack.imgur.com/ELll7.png
I noticed from inspect that he manipulates top and left properties and he gave images absolute position and dad fixed height so they don't pop out of elements, I tried to do it in CSS, but I think it needs javascript我从检查中注意到他操纵了 top 和 left 属性,他给了图像绝对位置和爸爸固定高度,所以它们不会弹出元素,我试图在 CSS 中做到这一点,但我认为它需要 javascript
That style is called masonry, and yes, there are JQuery plugins that will help you achieve that.这种风格被称为砌体,是的,有一些 JQuery 插件可以帮助您实现这一目标。 You will need to define a CSS Grid along with its elements, though.
不过,您需要定义一个 CSS Grid 及其元素。 Here's a plugin for Masonry galleries,
这是砌体画廊的插件,
https://masonry.desandro.com/#install https://masonry.desandro.com/#install
You'll need to add the file to your final website for it to work.您需要将该文件添加到您的最终网站才能正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.