Is there anyway to keep a jQueryUI
overlay in the same DOM position?
HTML
<div id="parent">
<div id="over" title="title">
Stuff
</div>
</div>
JS:
$('#over').dialog({modal: true});
If you inspect it on the DOM, you'll notice that the overlay gets moved to a direct child of document.body
Is there any way to keep it in it's starting position? (direct child of div#parent
)?
Not sure why you want this, but something like: http://jsfiddle.net/BGBuc/ should get you started.
JS
$('#over').dialog({
modal: true,
create:function(event, ui) {
setTimeout(function(){
$('#parent').append($('div.ui-widget-overlay')).append($('div.ui-dialog'));
},1);
}
});