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?
move = $(this).detach();
That line removes the element from the DOM. Once you have done this it has no parent. Just remove this line all together.
$(this).parent().append(this);
should be sufficient. It will automatically remove the element and place it where it belongs.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论