我有一个项目 - 简单的游戏,到目前为止我可以拖放但我需要相同的可拖动图像 - 当删除时 - 更新显示在drop div ...
<script type="text/javascript" src="game/js/jquery1.5.min.js"></script>
<script type="text/javascript" src="game/js/jquery-ui1.8.min.js"></script>
$( init );
function init() {
$('#drag').draggable( {
containment: '#content',
cursor: 'move',
snap: '#content',
revert: true
})
$('#drop').droppable( {
drop: handleDropEvent
} )
}
function handleDropEvent( event, ui ) {
var draggable = ui.draggable;
//Replace Image....
var Num = 5;
Num--;
$(this).html('<img src="game/images/watermelon_-'+Num+'.png">').data(
);
//Call php Game->points(); to up points...
}