I have elements that I want to move around to other divs when they are clicked. I found appendTo, but I don't know how to let the element fly to the other div in transition.
<div id="top">
<button id="b1">B1</button>
</div>
<br>
<br>
<br>
<br>
<div id="bottom">
<button id="b2">B2</button>
</div>
<script>
$('#b1').click(function() {
$('#b1').appendTo($('#bottom'));
})
$('#b2').click(function() {
$('#b2').appendTo($('#top'));
})
</script>
Is there a simple way to make the buttons 'fly' after they are clicked? For now, I just make them fade out and into the new div.