Assuming I have 4 divs whose class is "block". With jQuery I'd like to split the divs into blocks of 2, and "enclose" each sets of "blocks" inside another div.
I would like to make the code very dynamic, so that by adding multiple "blocks" jQuery will automatically split and insert the containment div.
EX ::
Before division
<div class="bloco"></div>
<div class="bloco"></div>
<div class="bloco"></div>
<div class="bloco"></div>
After the "split"
<div class="contain">
<div class="bloco"></div>
<div class="bloco"></div>
</div>
<div class="contain">
<div class="bloco"></div>
<div class="bloco"></div>
</div>