Link to home
Start Free TrialLog in
Avatar of HLRosenberger
HLRosenbergerFlag for United States of America

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; ");
			
	}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of dimmergeek
dimmergeek
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HLRosenberger

ASKER

thanks.
Thank you!