HLRosenberger
asked on
help with javascript - centering a modal dialog
I have this code that I use to center a modal dialog. it used to work for IE and Firefox. My harddrive crashed, and I had to reinstall my entire development environment. Now, this code works for IE, but not Firefox. Any idea why? Any better way to center a modal dialog?
var WIDTH = 850;
var HEIGHT = 850;
function ShowIncident(incident_id) {
var top = (screen.height / 2) - (HEIGHT / 2) ;
var left = (screen.width / 2) - (WIDTH / 2);
page = "../tds_incident/ShowTds_Incident.aspx?Tds_incident=" + incident_id
mywindow = window.showModalDialog(page, null,
"scroll:yes; resizable:no; help:no; " +
"dialogTop:" + top + "px;" +
"dialogLeft:" + left + "px; " +
"dialogWidth:" + WIDTH + "px; " +
"dialogHeight:" + HEIGHT + "px; ");
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thank you!
ASKER