CodeGrabber
{ USER }
posts: 23
last: 28-Apr-2008
TITLE: JavaScript pop-up
DESCRIPTION: Pops up a new window centered relative to the clients screen
Submitted: 28-Nov-2007 04:30:20 ( 1yrs 5w 6d 0h ago ) Language: JavaScript (*.js *.jscript *.jsb)
Views: 181 Lines of Code: 16 LINES
Rating:
rate: star1
star2
star3
star4
star5
dstar1
dstar2
dstar3
dstar4
dstar5  ( rated! )
  { 0.00 / 5 }
Difficulty: Intermediate
Bookmark
/* Author: 
   Date: 28-11-2007
   Filename: 
   Description: 
   History: 
*/


function popUp(url, w, h, feat) {
    var l = (screen.availWidth / 2) - (w / 2),
        t = (screen.availHeight / 2) - (h / 2),
        new_win = window.open(url, 'popup', feat + ', width=' + w + 
                ', height=' + h + ', left=' + l + ', top=' + t);
    new_win.focus();
    return false;
}