jQuery Mobile 2-page Base Fiddle
HTML
<script src="http://code.jquery.com/mobile/latest/jquery.mobile.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/mobile/latest/jquery.mobile.min.css">
<div id="divMain" style="position: relative">
<div id="div_column1" style="width:200px;height:auto;float:left;margin-top:30px;margin-left:20px" class="column sortable-list">
<div id="div_pz0" style="position: relative;">
<div class="portletContainer" id="div_pz0pi0">
Click Here
<div>
</div>
<div>
</div>
CSS
#divMain
{
width:500px;
height:500px;
border-width:2px;
border-style:dashed;
border-color:red;
}
.portletContainer
{
width:100%;
border: 2px ridge gray;
background:rgb(120,120,240);
position: absolute;
}
.portlet_header
{
background-color: white;
padding: 6px 5px 4px 5px;
margin-bottom: 3px;
height:21px;
}
.portlet_body
{
height:auto;
background:rgb(175,175,175);
}
.draggable
{
cursor: move;
}
JavaScript
$(function () {
$('#div_pz0pi0').click(function () {
var current = $(this);
var prependToDiv = $('#divMain');
/*
current.prependTo(prependToDiv);
current.text('Moved');
});*/
current.animate({
top: -30,
left: -20
}, 2000, function() {
current.prependTo(prependToDiv).css({
top: 'auto',
left: 'auto'
});
})
});
});