是否有技巧可以使 jquery 对话框在任何时候都可以拖动? (我的意思不仅是在标题栏中)
最佳答案
与可排序项相反,对话框项没有该功能(我不确定为什么)。如果需要,您可以执行以下操作:
$(document).ready(function() {
var
// Create dialog
dialog = $('div')
.dialog({ title: "I'm a dialog" })
.css({cursor: 'move'}),
// Get the options manually
options = dialog
.data("dialog")
.uiDialog
.data('draggable')
.options;
// Finally, extend the draggable modal box's
// options and remove any restrictions
$.extend(options, {cancel: '', handle: ''});
});
请在此处查看工作示例:http://jsfiddle.net/gMP2d/
关于javascript - jquery 对话框 : drag dialog at any point,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3344693/