2010-11-23 81 views

回答

6

helper選項是默認'original'這將不正是你想要的東西,所以才離開的選項關閉,或將其設置爲'original',你會抓住原來......,而不是'clone'這使得副本。它應該看起來像這樣:

$(".element").draggable(function() { 
    helper: 'original' //or leave this line off 
}); 

You can test it in the default demo here

1

您還可以使用克隆:

pnlText.draggable({ 
    helper: "clone", 
    stop: function(event, ui) { 
     $(this).css("top",ui.position.top).css("left",ui.position.left); 
    } 
}); 

這個彈出原來當鼠標放手克隆的位置。