PDA

View Full Version : modal window resize?


Techno
06-04-2008, 06:55 PM
in javascript, is it possible to resize a modal window within itself? if so how?

so say if we did a postback in ASP.NET to the server, the modal dialog should be able to be resized - how can we resize this even though we opened this modal dialog with a specific set width and height?

Jon Hanlon
06-04-2008, 09:17 PM
Why do you want to resize a modal window?
Modal windows retain focus until they are closed. The application sits and waits for a response from a modal window, and I can't see why you would want the modal window to grow and shrink as the user tries to interact with it.

There is a resizeable paramter which allows the user to resize the modal window.
http://msdn.microsoft.com/en-us/library/ms536759(VS.85).aspx
resizable:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window has fixed dimensions. The default is no.

Techno
06-05-2008, 02:39 AM
Thanks. Right ok this is why....

Depending on certain options the user clicks on in this modal dialog, some items will not be visible anymore which causes the page in that dialog to shrink which means you will see a big white gap on the sides and the bottom of the modal dialog, this is why i want to be able to resize it within the modal dialog depending on what options user has selected. The link given isnt quite what im looking for :)

Jon Hanlon
06-05-2008, 05:53 PM
Hmmm
Have you tried a simple resize in the modal window?
window.resizeBy(-50,-50)
The trouble with this is that it's hard to know how much to shrink the window by.


Otherwise, play about with the background, margin and padding attributes of the modal's style and you can eliminate the white gap.