简体   繁体   English

如何以这种方式显示不同尺寸的图像? 是否有 jquery 插件可以做到这一点

[英]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.

相关问题 如何在同一页面上将插件用于不同版本的jQuery? - How can I use plugins for different versions of jQuery on the same page? 如何创建可根据不同手机尺寸调整大小的响应式图像? - How do I create responsive images that resize with different mobile phone sizes? 如何解决此 jQuery 插件冲突? - How do I solve this jQuery plugins conflict? 如何在浏览器中使用jquery插件? - How do I use jquery plugins with browserify? 如何检测浏览器是否可移动,并使用javascript“ if else”以不同大小显示视频? - How can I detect whether or not a browser is mobile and display a video at different sizes with javascript “if else”? 如何解决jquery冲突。 当我添加自动完成的jQuery插件时,其他jQuery插件不起作用 - How to solve the jquery conflict. when i add autocomplete jquery plugins other jquery plugins do not works 我如何居中对齐不同屏幕尺寸的文本 - How do i center align text in different screen sizes 如何为不同尺寸的图像创建简单的幻灯片显示 - How to create a simple slideshow for images of different sizes 如何在图库页面中布局不同尺寸的图像? - How to layout images with different sizes in gallery page? 我如何使用jQuery插件中的每个函数 - How do I work with the each function in jQuery plugins
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM