I have several divs (having the same class names). I want to move the div (always the same div that has the unique identifier #pos1 ) to the div that was pressed. So, for this purpose, I use the following code to find position1 (the div I want to move) and pos2 (press div).
However, I do not know how I can move (animate, etc.) divs from one position to another. I will use any help.
jQuery(".container").click(function() { var pos1 = jQuery("#pos1").position(); alert(pos1.top + ', ' + pos1.left); var pos2 = jQuery(this).position(); alert(pos2.top + ', ' + pos2.left); });
source share