Tricky css / javascript浮动任务 [英] Tricky css/javascript floating task
问题描述
我有一个设计,有几个div在不同的宽度/高度,我需要他们浮动基本上到左上角。一个简单的css float:left将不工作,因为它一旦下降到一个新的行不利用垂直空间。
I have a design that has several divs at varying widths/heights and I need them to float essentially to the top left. A simple css float:left will not work because it does not take advantage of the vertical space once it drops to a new line.
我假设我需要使用jQuery动态定位每个div,但我希望有人可以引导我朝正确的方向。
I assume I will need to use jQuery to dynamically position each div but I was hoping someone could lead me in the right direction.
这是一个标准的float剩下的做法:
标准浮动http://www.media1designs.com/poc/superfloat/diagram_float_left.gif
This is what a standard float left would do: standard float http://www.media1designs.com/poc/superfloat/diagram_float_left.gif
这是我需要做的:
我需要什么http://www.media1designs.com/poc/superfloat/diagram.gif
推荐答案
您是否尝试过 href =http://desandro.com/resources/jquery-masonry/ =nofollow> masonry插件?
这篇关于Tricky css / javascript浮动任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!