How can I make it so that when the new DIV is appended, the modal gets expanded?
I’m opening a modal window to edit some information with ajax. After submitting the information, I’m appending an Alert div to the modal window, but scrollbars are added to the modal because there was not enough room for the new div. Please keep in mind that I’m appending information from inside the modal itself!
Thanks a lot!!
edit: I’m using jQuery UI for the modal.
edit: this is how I open my modal:
$( "#btn_new" ).live('click',function() {
var iframe = $('<iframe src="users_new.php" />');
iframe.dialog({
autoOpen: true,
title: "Nuevo Usuario",
width: 370,
height: 520,
show: "fade",
hide: "fade",
modal: true,
resizable: true,
buttons: {
"Cerrar": function() {
$(this).dialog('close');
}
}
}).width(370 - 12).height(520 - 15);
});
Which modal frame work did you use? jquery UI? Lightbox? They are using fixed size so I think you have to modify the size yourself. After append the div you can add div height / width to the modal dialog.
Just example: