View Full Version : Opening a contained closable window within browser window

02-02-2011, 10:51 PM
I am looking to have a link open a closeable window that is contained within a browser window. If you click on the "sizing charts" link on this website, this is exactly what I am looking to do:


The window is contained within the current browser window, it can be dragged around, but not outside the parameters of the browser window.

Is there a title for this technique that I can research? Not looking to waste anybodys time, but if I can get steered in the right direction it would be greatly appreciated.


rnd me
02-02-2011, 11:19 PM
it's called a "modal" or sometimes a "modeless" window.
it used to be called a "dhtml popup", but scripts with that terminology are likely a bit dated.

there are probably jQuery plugins that you can use to achieve this very simply.

no matter what script you go with, test it in several browsers before rolling it out.

Philip M
02-03-2011, 10:28 AM
Is this what you mean?

<script type="text/javascript">

var win = null;
function NewWindow(mypage,myname,w,h,scroll) {
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
win = window.open(mypage,myname,settings);


<a href="#" onclick="NewWindow('http://www.google.com/','myPop','600','500','yes');" > Click Here For Popup </a>

Quizmaster: Which of these two boats is a palindrome - kayak or canoe?
Contestant: Canoe.