We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

luman on 06/29/06


Tagged

window popup


Versions (?)


Who likes this?

7 people have marked this snippet as a favorite

mate
meth
panatlantica
damarev
trof
vali29
chinlin62


popup center


Published in: JavaScript 


  1. function popup(url,name,windowWidth,windowHeight){
  2. myleft=(screen.width)?(screen.width-windowWidth)/2:100;
  3. mytop=(screen.height)?(screen.height-windowHeight)/2:100;
  4. properties = "width="+windowWidth+",height="+windowHeight+",scrollbars=yes, top="+mytop+",left="+myleft;
  5. window.open(url,name,properties)
  6. }

Report this snippet 

You need to login to post a comment.