Saturday, December 29, 2007

JavaScript: Resize and center a modal dialog on screen

// ***
// Resizes and centers a modal dialog on screen. For use in window_onload
// ***
function resizeCenterModalDialog(width,height)
{
top = (screen.height-height)/2;
left = (screen.width-width)/2;
window.dialogHeight=height + 'px';
window.dialogWidth=width + 'px';
window.dialogTop=top + 'px';
window.dialogLeft=left + 'px';
}

1 comment:

Please use your common sense before making a comment, and I truly appreciate your constructive criticisms.