Problem setting width and height for Dialog
Hi
I am new to this forum and quite new to jQuery as well. I have always been using Prototype but I finally made the switch to jQuery because of its good documentation and large user base.
I have a problem that I hope someone can solve. The problem is that I cannot correctly set a size of my dialog when loading the content using Ajax.
I have the following code:
-
$("#test").load('showList.php').dialog({
bgiframe: true,
resizable: false,
height: '500px',
modal: true,
title: 'The list'
});
The content is loaded but the dialog is not sized properly. I guess that it depends on the content being changed after the dialog has been initialized. Is there a nice way to solve this problem?
I tried the following solution (not very good looking but anyway...)
-
$("#test").load('showList.php').dialog({
bgiframe: true,
resizable: false,
height: '500px',
modal: true,
title: 'The list'
}).dialog('option', 'width', '70%').dialog('option','height','50%');
This causes the size to be correct but it doesnt center the window and it also removes scrollbars from the content. I must have the scrollbars but I want the dialog not to exceed the viewport.
Hopefully someone understands this better than I do...
Another solution is to download and use YET ANOTHER third party plugin but hey comeon, shouldnt jQuery UI be able to do this?