私はたくさんの div を持っています。それらはすべて画像を含む PHP 経由で出力されています。4 番目の div の後に注入したい 1 つの div がありますが、これを達成するのに問題があります。画像/divをグリッド化するためにIsotopeを使用しています。
私のjQueryの例:
$('.each-brewery-image:nth-child(4n)').after('<div>Test</div>');
私のHTMLの例:
<div class="each-brewery-image">
<a class="fancybox" rel="gallery1" href="#">
<span>
<img width="700" height="524" src="01.jpg" />
</span>
</a>
</div>
<div class="each-brewery-image">
<a class="fancybox" rel="gallery1" href="#">
<span>
<img width="700" height="524" src="02.jpg" />
</span>
</a>
</div>
<div class="each-brewery-image">
<a class="fancybox" rel="gallery1" href="#">
<span>
<img width="700" height="524" src="03.jpg" />
</span>
</a>
</div>