views:

429

answers:

1

I am creating a modal that will be used for different aspx pages that already exist, so the div that I have to hold the pages (which will be loaded through ajax.load method) needs to grow vertically and horizontally to fit the need of the different popup pages. How would I go about retrieving the height and width of the documents I will be injecting into the div so that I can animate the height and width to grow and shrink based on the aspx page being loaded in.

Thanks.

-Seth

+1  A: 

Rough demo here.

It will need changing to take into account of the dialog title so the content is not an exact fit but I am short on time.

Basically it adds the content requested via an .ajax call to a div that is positioned off screen. This allows us to calculate the dimensions. I then add that same content to the dialog when the dialog animation is complete.

redsquare