有没有一种简单的方法可以将jQuery UI对话框粘贴到特定的div?
实际上,应该可以拖动或调整对话框,但对话框不应该离开div。
<script>
var dialogOptions = {
title: "Recent",
closeOnEscape: false,
width:200,
position: {
my: "left top", at:"left+10 top+10", of:".frame"
},
"modal" : false,
"resizable" : true,
"draggable" : true,
appendTo: ".frame"
};
$( "div.dialog" ).dialog(dialogOptions);
</script>
<div class="frame">
<div class="dialog">
</div>
</div>
答案 0 :(得分:0)
试试这个: -
var dialogOptions = {
title: "Recent",
closeOnEscape: false,
width:200,
position: {
my: "left top", at:"left+10 top+10", of:".frame"
},
"modal" : false,
"resizable" : true,
"draggable" : true,
appendTo: ".frame" };
$( "div.dialog" ).dialog(dialogOptions).parent().resizable({
containment: ".frame"
}).draggable({
containment: ".frame"
})
答案 1 :(得分:0)
<强> JS: - 强>
var dialogOptions = {
title: "Recent",
closeOnEscape: false,
draggable: false,
width:200,
position: {
my: "left top", at:"left+10 top+10", of:".frame"
},
modal : false,
resizable : true
};
$( "div.dialog" ).dialog(dialogOptions).parent().draggable({ containment: ".frame" });