Manage Learn to apply best practices and optimize your operations.

Controlling pop-up windows through JavaScript

Controlling pop-up windows through JavaScript

Have you been wondering how to pop-up a new window in the center of the browser screen the way you desire. To actually center the pop up window, you need the use of the window objects outer width, and outer height property and screen object width and height property. Use the following code.

Function centerWindow() { if (document.all) { var xMax = screen.width, yMax = screen.height } else if (document.layers) { var xMax = window.outerWidth, yMax = window.outerHeight } else { var xMax = 640, yMax=480 } var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;'testpage.htm','Example','width=200,height=200,screenX='+x Offset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'') }
This was last published in June 2001

Dig Deeper on Domino Resources - Part 3

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...