jQuery - shuffling two absolutely positioned elements
<p>I have a container called three. It has the two divs inside as 'one' and 'two'. I would just like to shuffle their absolute positions. Is it possible? If so, is there any built-in function with <a href="http://en.wikipedia.org/wiki/JQuery" rel="nofollow">jQuery</a>?</p>

<p>This is my try, but it does not work properly:</p>

<h3>HTML:</h3>

<pre><code>&lt;div id='three'&gt;
    &lt;div id="one"&gt;1&lt;/div&gt;
    &lt;div id="two"&gt;2&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<h3>Code:</h3>

<pre><code>var clone1 = $('#one').clone();
var colone2 = $('#two').clone();

var clone1X = $('#two').position().left
var clone1Y = $('#two').position().top;

var clone2X = $('#one').position().left;
var clone2Y = $('#one').position().top;

$('div &gt; div').remove();

$('div').append($(colone2).css({left:clone1X,top:clone1Y})).append($(clone1).css({left:clone2X,top:clone2Y}));
</code></pre>

<p>But does not work as I expected.</p>
