Javascript : Open a pop-up center window
75Javascript : Open a pop-up center window
I was having trouble focusing on the screen a new window that was open through a javascript function, until today to demand in some forums discovered a way of doing it.
This way is valid for any resolution because the calculation of the position of the window is based on the size of each screen:
function openWindow()
{var winW = 600;
var winH = 400;
var winX = (screen.availWidth - winW) / 2;
var winY = (screen.availHeight - winH) / 2;
var features = 'left=' + winX + ',top=' + winY +
',height=' + winH + ',' + 'width=' +
winW + ',status=yes,' + 'toolbar=no,
menubar=no,location=no';
window.open('Teste.aspx', null, features);return false;
}
I hope this may be useful to someone.
This post is on my personal blog too, in portuguese languange, here.
|
|
HTML JAVASCRIPT CSS Software Video Tutorial on 3 DVDs
Current Bid: $34.57
|
|
|
HTML JAVASCRIPT CSS Software Tutorial Training 3 DVDs
Current Bid: $24.57
|
|
|
NEW Javascript - Flanagan, David ...
Current Bid: $31.10
|
|
|
Learning JavaScript, Shelley Powers, Very Good Book
Current Bid: $2.45
|
|
|
Webmaster Tools Second Edition, a Javascript generator!
Current Bid: $5.00
|
|
|
Learn Web Design HTML JAVASCRIPT CSS Video Training DVD
Current Bid: $34.57
|
PrintShare it! — Rate it: up down flag this hub








