Clever Code
- Started
- Last post
- 4 Responses
- DavidFelt
Any of you NT'ers know how I can make a pop up window open in the centre of the screen no matter what the resolution of the users screen is.
I know how to position it using pixel values but obviously what is centre for 1024 x 768 is not for 800 x 600.
Anyone know how to do this?????
Thanks
- DavidFelt0
Come on...I know you know, you know
- ********0
there was an answer to exactly that question here just the other day but I cannot find it.....
surely you could get the screen width and the screen height with JS onLoad then depending on what the returned screen res is place your window accordingly.... no??
- DavidFelt0
Probably but I'm a fool... I dont know how to do that, if theres any examples of websites that use this technology or anyone can help out that would be great.
Cheers
- ozhanlion0
function thecenter(x_px,y_px) {
h=(window.screen.availWidth-x_px...
v=(window.screen.availHeight-y_p...
return 'top='+v+',left='+h+',';
}