Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need my pop up to be centred in browser window please.

Status
Not open for further replies.

dirtystim

Technical User
Jul 4, 2001
26
GB
Hello friends.
i wonder, could someone be kind enough to twll me how to
slightly alter my lovely pop up script so it pops the window up in position centre centre?

I really want to use this particular script but I don't know how to add this extra instruction . ..

Please help if you can,
Many many thanks.

d

win="";
function pop_up(){
win = window.open("copypop.htm", "dep", "height=200,width=300", hotkeys="no");
}
function closeDep() {
if (win=="undefined"){}else{
if (win.open) win.close();
}
}
 
hope this helps...


function pop_up() {

var h = '200';
var w = '300';
var winl=(screen.width - w) / 2;
var wint=(screen.height - h) / 2;
winprops='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=no,hotkeys=no'

win=window.open('copypop.htm','dep',winprops)

if (parseInt(navigator.appVersion) >= 4) {win.window.focus();}

}


- spewn
 
Hey Spewn!
Sorry for the delay M8! :)

And Thanks Loads for ya help!!
I a implementing this across all my pages right now!!

Thank you my pal!

d
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top