我应该找到一种通过jquery来重组元素的方法,具体取决于具有3个元素或每行包含3个元素的类,应该只有一个customBackgroundViewDue。
我有一个由12个元素组成的表,每行最多可容纳3个元素,当我根据类别重新组织单击时,显然没有考虑不同的大小,然后将它们随机组织。我需要一种按类别(但可以到此为止)和间距进行组织的方法,因此每一行必须具有2个1x大小的块和1个2x大小的块。 这是我的代码:
<div class="row ">
<div class="col-sm-12">
<div class="customAllBlockViewHome customBackgroundViewUno panificazione" style="background-image: url('http://demo.webpreview.cloud/mastermartini/wp-content/uploads/2018/06/892H2RCZ3Tf6gH3xSRP-275x244_center_center.jpg');">
<div class="customTextAndIconViewHome">
<div class="customIconViewHome">
</div>
<div class="customTextViewHome">
Prova 6
</div>
</div>
</div>
</div>
</div>
<div class="row ">
<div class="col-sm-12">
<div class="customAllBlockViewHome customBackgroundViewDue" style="background-image: url('http://demo.webpreview.cloud/mastermartini/wp-content/uploads/2018/06/704Mo04I0iSn1OvKLIS-275x244_center_center.jpg');">
<div class="customTextAndIconViewHome">
<div class="customIconViewHome">
</div>
<div class="customTextViewHome">
Prova 5
</div>
</div>
</div>
</div>
</div>
<div class="row ">
<div class="col-sm-12">
<div class="customAllBlockViewHome customBackgroundViewUno laboratori" style="background-image: url('http://demo.webpreview.cloud/mastermartini/wp-content/uploads/2018/06/892H2RCZ3Tf6gH3xSRP-275x244_center_center.jpg');">
<div class="customTextAndIconViewHome">
<div class="customIconViewHome">
</div>
<div class="customTextViewHome">
Prova 4
</div>
</div>
</div>
</div>
</div>
<div class="row ">
<div class="col-sm-12">
<div class="customAllBlockViewHome customBackgroundViewDue" style="background-image: url('http://demo.webpreview.cloud/mastermartini/wp-content/uploads/2018/06/9171zU8RKgk5VolazgI-275x244_center_center.jpg');">
<div class="customTextAndIconViewHome">
<div class="customIconViewHome">
</div>
<div class="customTextViewHome">
Prova 2
</div>
</div>
</div>
</div>
</div>
有没有人做过类似的事情,您能帮我吗?
预先感谢