Test Case Boilerplate
Fork this way...
HTML
<script src="http://code.jquery.com/ui/jquery-ui-git.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/jquery-ui-git.css">
<div class="draggables">
<div class="randomcontainer">
<div class="draggable"></div>
</div>
</div>
CSS
.draggable {
width: 100px;
height: 100px;
background-color: blue;
}
.helper {
width: 50px;
height: 50px;
background-color: red;
}
JavaScript
$(document).ready (function () {
$('.draggable')
.draggable ({
'appendTo': 'body',
'helper': function () {
return $('<div class="helper"></div>');
}
})
.bind ('dragstart', function (ev, ui) {
window.setTimeout (function () {
$('.draggables').empty ();
}, 1000);
})
});