Is there a way to prevent jQuery UI dialog from going above or below #top
div? I'm not looking for z-index solution, but rather something like offset from the top. In this case dialog should be unable to be moved to area where is #top
div.
Any suggestions?
HTML:
<div id="top"></div>
<div id="dialog">My dialog</div>
JS:
$(document).ready(function() {
jQuery("#dialog").dialog({
autoOpen:true,
modal: false,
resizable: true,
draggable: true,
closeOnEscape: true,
title: "Title",
open: function(){
jQuery('.ui-widget-overlay').bind('click',function(){
jQuery('#dialog').dialog('close');
})
}
});
});
JSFIDDLE: https://jsfiddle.net/9gku6qrh/
This might be what you're looking for - Keep a jQuery dialog in a div - you would just need put a parent container around #dialog
.