Can anyone show me how to set it to auto center on browser resize? I know there are many answered questions regarding this matter, but I’m a total amateur. I need someone to rewrite the following code for me, please.
Thanks.
<script type="text/javascript">
function openDialog(url) {
$("<div class='popupDialog'>Loading...</div>")
.dialog({
autoOpen: true,
closeOnEscape: true,
width: '900',
height: '800',
modal: true,
title: 'Bonus Features'
}).bind('dialogclose', function() {
jdialog.dialog('destroy');
}).load(url, function() {
$(this).dialog("option", "position", ['center', 'center'] );
});
}
</script>
I’m not very familiar with jdialog or whatever plugin you’re using, however, you can bind onto the window resize event.
If there’s no method to resize the “jdialog” you could just close and reopen the dialog every time, but that seems undesirable.