Trouble with dragged revert at multiple block movement

拥有回忆 提交于 2019-12-11 07:05:03

问题


At the following link : http://probl.frizi.net/ i'm trying to set variable size and position blocks. The colored blocks need to stay within the gray big block. Anyhow I'm trying to keep the colored blocks inside, they tend (at second movement) to deform or to go on a different possition as they started. Revert method is not working as it should or I didn't implemented it correctly.

Till far, I'm trying to do the following (please rightclick and see the Jquery source on the page):

var item;
$( "#droppable" ).droppable({
out: function(event, ui) { 
    $(item).draggable({ revert: true });
    var revert = $(item).draggable( "option", "revert" );
    $(item).draggable( "option", "revert", true );
    }
}); 

$(".blk").draggable({
    start: function(event, ui) { 
    item = $(this);
}
});

来源:https://stackoverflow.com/questions/6797724/trouble-with-dragged-revert-at-multiple-block-movement

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!