<div>
それぞれにいくつの要素があるかを知る必要があります<li>
。だからそのようなもの:
<ul>
<li>
<div> Some image 1 </div>
<div> Some image 2 </div>
<div> Some image 3 </div>
</li>
<li>
<div> Some image 4 </div>
<div> Some image 5 </div>
</li>
<li>
<div> Some image 6 </div>
<div> Some image 7 </div>
<div> Some image 8 </div>
<div> Some image 9 </div>
</li>
</ul>
関数の出力:
First <li> has 3 <div>
Second <li> has 2 <div>
Third <li> has 4 <div>