I am trying to create an infinite cycle of elements using the following code:
$('div').click(function(){
move = $(this).detach();
$(this).parent().append(move);
});
but it just seems to be removing my objects, rather than moving them to the end of the list in order to create the cycle
Where are I going wrong?
should be sufficient. It will automatically remove the element and place it where it belongs.