I use this javascript / jQuery to open a dialog, however, when I scroll down the page and open another window after closing the first window, the window opens in my selection position, plus the position I scroll down. When I try to move it, it will continue to jump down , causing a very annoying result.
function showDialog(url) {
dialogFrame = $('<iframe style="width:100% !important;" frameborder="0" id="Dialog" src="' + url + '" />').dialog({
autoOpen: true,
height: 500,
width: 1000,
title: 'myWindow',
resizable: false,
modal: true,
position: {
my: "center",
at: "center",
of: window
}
});
}
How can I prevent this behavior? Probably it is position : { }, but what should it be?
source
share