gpt4 book ai didi

jQuery 砌体 : Auto-resize photos like Beyonce's website

转载 作者:行者123 更新时间:2023-12-01 00:45:10 24 4
gpt4 key购买 nike

jQuery Masonry 的网站在其展示中包含 Beyonce 的网站:

http://iam.beyonce.com

但它没有显示她如何实现自动调整大小的效果。 I ran her code through a prettifier ,但看起来还是很乱:

function resize() {
1024 < $(window).width() ? 0 == headerNavOpen && $("#header").css({left:-$(window).width()}) : 0 == headerNavOpen && $("#header").css({left:-1024});
$(".index .post.video").css({width:"33.2%", height:0.332 * $("#container").width() / 1.778})
}

有人知道达到相同效果的更简单方法吗?

这是一个基本设置的 fiddle :http://jsfiddle.net/CfsEb/

最佳答案

参见http://metafizzy.co/blog/beyonce-seamless-fluid-image-masonry/

designedmemory came up with a much better solution. Instead of trying to get exactly 3 columns in the layout, the columns are sized just a fraction to be less than the ideal. Then the images are sized to be just a little bit bigger to cover the gap. Brilliant!

/* not quite 33.3% */
.item { width: 33.2%; }

/* images cover up the gap */
.item img { width: 100.5%; }

关于jQuery 砌体 : Auto-resize photos like Beyonce's website,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14674930/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com