PDA

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



keithiopian
02-02-2011, 09: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:

http://www.bella.com/mapper.php?pageid=40

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.

Thanks

rnd me
02-02-2011, 10: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, 09: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 =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings);
}

</script>

<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.