Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery: Plugin like masonry to overcome dom-order and 3 item sizes
    primarykey
    data
    text
    <p>this might be tough to explain. Is there a similar plugin like jQuery masonry that is able to detect spaces in a predefined grid and move and position elements that would fit into this spaces?</p> <p>Since all other ways of explaining my question would be way to complicated I've drawn a simple image to show what I mean.</p> <p>Notice: It's a fluid responsive webdesign.</p> <p><img src="https://i.stack.imgur.com/873Lj.jpg" alt="enter image description here"></p> <p>So my dom-order is 1,2,3. However when collapsing my layout within a certain <code>media-query</code> I want to dynamically switch the dom order or position the elements differently. Just like you see in my sample.</p> <p>I know there is stuff like <a href="http://masonry.desandro.com/" rel="noreferrer">jQuery Masonry</a> or <a href="http://isotope.metafizzy.co/" rel="noreferrer">jQuery Isotope</a> but both of those plugins don't fill all empty spaces of the grid. E.g. check out this isotope screenshot …</p> <p><img src="https://i.stack.imgur.com/ONUMh.png" alt="enter image description here"></p> <p>There is one element missing. Of course in most cases this is what you want to keep the order of the elements. In my case I don't care about the order, I just want to have all spaces and gaps filled. So exactly like you see my sketch above, the <code>item-nr-3</code> should be moved upwards to fit the empty gap (since it would fit in). And if there would be another <code>item</code> the same size it would fit in the gap underneath <code>item-nr-3</code>.</p> <p>Is that somehow possible? Is there some jQuery Plugin that does that? Or do you have any other idaes?</p> <hr> <p><strong>Some additional information:</strong> The <code>items</code> and boxes I'm talking about are all set to <code>box-sizing:border-box</code> so I do not have to worry about paddings or margins.</p> <hr> <p><strong>Update:</strong> Here is a live sample of the problem: <a href="http://jsfiddle.net/r79u2/1/" rel="noreferrer">http://jsfiddle.net/r79u2/1/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload