Change size of dialog window

S

Saeed Sedighian

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,document.body.scrollWidth)+30);
else
growWidth = document.body.offsetWidth;

window.resizeTo(growWidth,growHeight);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top