Cleanest way to move child-element to last position with jqeuery?
<p>This is how I currently do it:</p>

<pre><code>function switchcontent(wait){
    //fade out image1
    $('#feature-img img:first-child, ').delay(wait).fadeOut('slow', function() {
        //fade in imag2
        $('#feature-img img:nth-child(2)').fadeIn('slow');
        var prev_img = ($(this).clone())
        $('#feature-img').append(prev_img);
        $(this).remove()
        switchcontent(wait);
    });
};
</code></pre>

<p>I'm not very satisfied with this solution, specially since i want to apply it to another element of child-elements aswell.</p>

<p>current HTML:</p>

<pre><code>&lt;div class="images span7"&gt;
  &lt;img src="featured_1.png"&gt;
  &lt;img src="featured_2.png"&gt;
&lt;/div&gt;
</code></pre>

<p>I would like something that could also apply to: </p>

<pre><code>&lt;div class="feature-text"&gt;
  &lt;div&gt;
    &lt;h1&gt;Lugn i din eknonomi&lt;/h1&gt;
    &lt;p&gt;Zenconomy är smart fakturering, redovisning och rapportering på nätet. Vi underlättar vardagen för företagare, redovisningsbyråer och programmerare.&lt;/p&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;h1&gt;GRAPH&lt;/h1&gt;
    &lt;p&gt;GRAPH OF APPROVAL!&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>or any other element with childs in it for that matter :)</p>
