我正在尝试移动带有stamp2 类的元素,所以它在第五个孩子之后。这是我尝试的。该项目似乎已删除。
$('.stamp2').remove().after('.section:nth-child(5)');
html:
<section class="photo small stamp stamp1">..</section>
<section class="photo small stamp stamp2">..</section>
<section class="photo small">..</section>
<section class="photo small">..</section>
<section class="photo small">..</section>
<section class="photo small">..</section>
<section class="photo small">..</section>
<section class="photo small">..</section>
<section class="photo small">..</section>
<section class="photo small">..</section>
<section class="photo small">..</section>
<section class="photo small">..</section>
<section class="photo small">..</section>
<section class="photo small">..</section>