多个块移动时拖动恢复出现问题
在以下链接中: http://probl.frizi.net/ 我正在尝试设置可变大小和位置块。彩色块需要留在灰色大块内。无论如何,我试图将彩色块保留在内部,它们往往(在第二次运动时)变形或在开始时处于不同的位置。恢复方法无法正常工作,或者我没有正确实现它。
到目前为止,我正在尝试执行以下操作(请右键单击并查看页面上的 Jquery 源代码):
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);
}
});
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);
}
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论