showModalDialog - window size

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Moriarty
Forum Newbie
Posts: 8
Joined: Tue Aug 22, 2006 9:33 am
Location: London, England. Home of Dangermouse.

showModalDialog - window size

Post by Moriarty »

Hi. Its the first time Ive used the showModalDialog function and was wondering how best to size the dialog to compensate for the window borders.

My command looks a bit like this:

Code: Select all

onclick='window.showModalDialog("BigBadForm.htm","Arg1","dialogHeight: 500px; dialogWidth: 700px; dialogTop: 150px; dialogLeft: 150px; edge: Raised; center: No; help: No; scroll: No; status: Yes;")'
While I set the width and height to 700 and 500 respectively, the internal size of the window.document object comes out to be 694 and 448.

Any help would be appreciated.

Thanks,
Moriarty
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Create the window at whatever size you want, check the internal width once the page renders and adjust the window to compensate.
Moriarty
Forum Newbie
Posts: 8
Joined: Tue Aug 22, 2006 9:33 am
Location: London, England. Home of Dangermouse.

Post by Moriarty »

Thanks, Feyd, but this only works with non-modal dialog boxes (as I understand it).

I've tried doing the auto-resize thing and whilst it works with window.open(ed) screens, it won't behave with showmodaldialog(ed) windows.

Thanks for taking the time, though.
Post Reply