[thelist] IE popup windows

Keith cache at dowebs.com
Wed Jan 23 13:44:25 CST 2002


paul
> 
> just a quick question, im automatically opening a new window, now Ive
> seen some pop up windows on some site take away the title bar - so the
> pop up looked like a page floating above the site behind it - does
> anyone know how this is done, or know of a site that has a window that
> does this so i can go and get the code?


That's called a chromeless window. Here's a url of a chromeless 
that creates it's own title bar. Scroll to the bottom of the page and 
click Launch ColorMe. The exact same page that appears in the 
chromeless window was also used in a downloadable .hta creating 
a standalone windows app, that's what the Download ColorMe link 
refers to.

http://doware.dowebs.com/colorme/

Most of the scripts I've seen for this effect fail to understand just how 
simple this really is. Basically you open an IE window to fullscreen, 
then IMMEDIATLY resize and reposition the window with a 
document.write, then call the page you want in it. If you don't resize 
with a doc.write and put the resize on the page being called the 
user will think their screen has crashed while they wait for the page 
being called to arrive. The ColorMe actually DOES wait since it 
was designed to be an hta so you can see there what I mean.

Here's my favorite code for launching a chromeless window in IE 
and a regular window in NN4

<html><head>
<script language=javascript>
function launch(url,wid,hei){
if(document.all){
win=window.open("","CM","fullscreen")
win.document.open()
win.document.write('<html><body>'+
'<script>resizeTo('+wid+','+hei+');'+
'LeftPos=(screen.width-'+wid+')/2;'+
'TopPos=(screen.height-'+hei+')/2;'+
'moveTo(LeftPos,TopPos);'+
'window.focus();'+
'location="'+url+'"</scr'+'ipt>'+
'</body></html>')
win.document.close()
}else{
win=window.open(url,"CM","status=0,width="+wid+",height="+hei)
}
}
</script>
</head>
<body>
<a href=javascript:launch("pop.html","400","300")>here</a>
</body>
</html>


OK, that gets the chromeless open, BUT that's when your work 
begins. Since a chromeless has no titlebar you need to create an 
obvious way for the user to close the window with window.close() 
and preferably a titlebar so they can grab the window and move it. 
All that syntax needs to of course be on the page being loaded, and 
ignored by NN4 which will have a title bar. 

keith




More information about the thelist mailing list