Categories
- Ajax (1)
- Bisdak Blogger (1)
- chicks (1)
- Coffee and Paste (1)
- css (5)
- Excel (1)
- General Info (5)
- HTML (1)
- javascript (8)
- more (8)
- MySQL (1)
- pdf (1)
- Photoshop (1)
- PHP (26)
- SEO (1)
- sports (2)
Blog Archive
-
▼
2009
(38)
-
►
March
(13)
- strlen vs isset in PHP
- 40 Tips for optimizing your php code
- $HTTP_SERVER_VARS
- Cross browser compatibility test site
- Detecting Mobile Browsers in PHP
- Passing JavaScript variables to PHP
- single-quote( ' ) vs double-quote ( " ) in PHP
- PHP Arrays
- Advantages of Using Functions
- Differences between constants and variables
- $_GET vs $_POST in PHP Forms
- require() vs include() in PHP
- What does !important mean in CSS?
-
►
February
(12)
- Javascript onclick return false does not work in I...
- Coffeeandpase Blogger: A Heavy Downloader
- Where is php.ini?
- Make a face
- Turn your photo into a cartoon
- Retrieving Japanese Text from MySQL using PHP
- CSS Play: Experiments with CSS
- New Online MD5 Hash Cracker!
- PNG Alpha Transparency Fix in IE
- Blogger.com as a website instead of a blog?
- Email address validation using Javascript
- PHPMailer: SMTP Authentication
-
►
March
(13)
-
►
2008
(14)
-
►
December
(8)
- Simple php pagination
- Create Image Thumbnails Using PHP and GD
- How to create a dynamic bar graph using PHP and GD...
- How to create a dynamic line graph using PHP and G...
- Simple PHP Image Watermark
- Manny Pacquiao vs Oscar De la Hoya (The Dream Matc...
- Live free streaming!!! Pacquiao vs. De La Hoya
- Javascript equivalent for PHP Functions
-
►
December
(8)
Blog Roll
- Monkeetech
- Atenean101
- Batangsaag.blogspot.com
- Batangyagit.com
- Bethelo
- beyond-the-norms.org
- Brightartclass.blogspot.com
- Bugits
- Cebu Directories
- Cebudaily.com
- CebuCityLife.com
- CebuElection
- Cebuheritage.com
- Cebuimage.blogspot.com
- Cebupacificairlines.ph
- Codes Depot
- Dahonglaya.com
- Empressofdrac
- Errol Duazo
- EUTS
- Iamdownloader.com
- Ibeejing
- Icymartagimacruz
- Ie-student
- In-indie.org
- Jerry Gervacio
- Lagahit.com
- Marian Calago
- Marroxas2010
- Mcbilly.com
- miscelstuffs.blogspot.com
- Miongandmarquee
- Nurseter
- Pinoyworld.org
- Punkies07
- QueerChef
- rentale
- Sinjin.ph
- softwareportables
- Sunchoke.net
- VeganPrince
- Vera
- Veryducky
- Yugatech
Posted by
reynold
In:
javascript
Javascript: window.open pop-up at center
In javascript - window.open opens a popup that by default opens at random location of the window. Below is a javascript function that will open a pop-up in the center of the client window. Hope it may save many additional lines of javascript code.
function popupwindow(windowUri, windowHeight, windowWidth, windowName)
{
var centerWidth = (window.screen.width - windowWidth) / 2;
var centerHeight = (window.screen.height - windowHeight) / 2;
newWindow = window.open(windowUri, windowName, 'resizable=0,width=' + windowWidth +
',height=' + windowHeight +
',left=' + centerWidth +
',top=' + centerHeight);
newWindow.focus();
return newWindow.name;
}
{
var centerWidth = (window.screen.width - windowWidth) / 2;
var centerHeight = (window.screen.height - windowHeight) / 2;
newWindow = window.open(windowUri, windowName, 'resizable=0,width=' + windowWidth +
',height=' + windowHeight +
',left=' + centerWidth +
',top=' + centerHeight);
newWindow.focus();
return newWindow.name;
}
Please notice parameters that are passed to window.open.
This entry was posted on Friday, August 21, 2009
and is filed under
javascript
.
You can follow any responses to this entry through
the RSS 2.0 feed.
You can leave a response,
or trackback from your own site.
Posted on
-
2 Comments
Subscribe to:
Post Comments (Atom)



2 comments:
hi,,, can we link exchange pls with my blogs:
Shadows of Me
Movie Reviews
pls let me know. thanks
hi., thanks. done adding your blog too in my blogroll.
Post a Comment