i read the link you posted did you used the plugin $.fn.shuffle
or the second one "untested say by the author" if you used the first one as i think
the you should read carefully at the top page of the link it says
** ** ** **
I was recently looking for a decent way of shuffling a set of
elements. I found a jQuery plugin which claimed to do exactly that but
unfortunately it only works if all elements are direct descendants of
a single parent, like all list items under an unordered list.
** ** ** **
加上我的密码HTML
<div class="content">
<p>文字1</p>
</div>
<div class="content">
<p>文字2</p>
</div>
<div class="content">
<p>文字3</p>
</div>
<div class="content">
<p>文字4</p>
</div>
<div class="content">
<p>文字5</p>
</div>
<div class="content">
<p>文本6</p>
<img src="./images/1.png" />
</div>
but again
it only works if all elements are direct descendants of a single parent, like all list items under an unordered list
工作很好,但很精准
i 使用了下面的脚本, 并在 div 元素 strong > 中插入图像 < strong >
$("document").ready(function() {
$("div").shuffle();
});
输出输出
文字5
文字3
文字4
文字2
文字1
文本6
他们忽然地摇摆着,