window.showModalDialog dialogHeight / dialogWidth don't appear to be working in IE 8

John Reilly picture John Reilly · Jul 5, 2011 · Viewed 10.1k times · Source

Having been marooned on IE 6 for 10 years the company I work for has suddenly announced that we're migrating to IE 8 for our intranet apps. Having taken a quick look all seems to work fine in IE 8 for ours but there seems to be a quirk with window.showModalDialog that I was wondering if anyone could help with?

Basically the code below is executed in IE6 and opens up a window of the width / height I would expect:

//Set options
var sOptions = 'dialogWidth:247px; dialogHeight:181px; dialogLeft:100px; dialogTop:100px; status:no; scroll:no; help:no; resizable:yes';

//Open dialog
var oValue = window.showModalDialog(sURL, null, sOptions);

However, in IE 8 (or I guess IE 7 given that on intranet apps it will be forced to "Compatibility Mode") the dialog is opened with a larger width / height.

Does anyone know what might be causing this? I've a vague idea there might be a minimum width / height being enforced but I can't find any documentation to back this up...

Answer