Friday, March 16, 2012

Modal Window : (Change) Size Problem

Hello All.
I open a window using showModalDialog function.
(window.showModalDialog('webform2.htm',null,'resizable:yes'))
In modal window after page loaded i want to change size of window
using
window.resizeTo(growWidth,growHeight) .
but this not works.
If page open with window.open anything works good.
I don't know size of my pages.I used below JavaScript to dynamically
change size of window to appropriate size :
growHeight = document.body.scrollHeight - document.body.clientHeight;
if (growHeight > 0)
growHeight = Math.min(screen.availHeight,Math.max(document.body.offsetHeight
,document.body.scrollHeight)+60);
else
growHeight = document.body.offsetHeight;
growWidth = document.body.scrollWidth - document.body.clientWidth;
if (growWidth > 0)
growWidth = Math.min(screen.availWidth,Math.max(document.body.offsetWidth,do
cument.body.scrollWidth)+30);
else
growWidth = document.body.offsetWidth;
window.resizeTo(growWidth,growHeight);
Thank All.See if this helps
http://msdn.microsoft.com/workshop/...efs/showModalDi
alog.htm
Regards
Trevor Benedict R
MCSD
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

0 comments:

Post a Comment