I want to position a modal dialog popup on the bottom right corner of the user's monitor. Right now I use these parameters, which work on most regular aspect monitors:
But on a widescreen monitor it doesn't go as far right as it should, and I don't want to increase the dialogLeft parameter any more in case someone has a browser that would make the window appear off the screen.
So I find out the user's screen size, and set two parameters to use as a position, like this:
Code:
var x = window.screen.availWidth - 400;
var y = window.screen.availHeight - 400;
Now I should be able to put x and y into dialogLeft and dialogTop in the popup code, but they just don't work.
Positions the dialog bottom right corner of the screen
Code:
var x = window.screen.availWidth - 400;
var y = window.screen.availHeight - 400;
window.showModalDialog("noob.htm", "","dialogWidth:400px; dialogHeight:400px; dialogTop:"+y+"px; dialogLeft:"+x+"px; center:no; status:no")};
The dialog can not be placed off screen, so you could use huge values for it's position and still it would be placed in the corner of the screen..
Last edited by Fang; 11-25-2010 at 10:00 AM.
At least 98% of internet users' DNA is identical to that of chimpanzees
Bookmarks