Jef*_*ffz 16
或者你可以用更简单,更"jQuery方式"来做到这一点;)
$(document).ready(function(){ $('#dialog'). dialog({ //your dialog options go here }). dialog("widget").draggable("option","containment","none"); //this chained sequence kills containment });
bet*_*max 10
如果你扩展jQuery对话框代码,你肯定可以.只需包含以下代码:
$.ui.dialog.prototype._makeDraggable = function() {
this.uiDialog.draggable({
containment: false
});
};
Run Code Online (Sandbox Code Playgroud)
它将覆盖"document"的默认包含值false
,禁用包含.