Pages

Sunday, October 31, 2010

Chromeless Windows

A chromeless window is a pop-up window that is completely customized to match your site. Here is an example. It will work on IE 4.5 and up; on other browsers it will open a regular window about the same size.
To make your own chromeless window, download this ZIP file. In it is the JavaScript and the images you'll need.
Add the following code between the <head> and </head> tags.
__________________________________________________________________________
<script src="chromeless_35.js"></script>
<script language="javascript">
function openIT(u,W,H,X,Y,n,b,x,m,r) {
  var cU  ='close_up.gif'
  var cO  ='close_ovr.gif'
  var cL  ='clock.gif'
  var mU  ='min_up.gif'
  var mO  ='min_ovr.gif'
  var xU  ='max_up.gif'
  var xO  ='max_ovr.gif'
  var rU  ='res_up.gif'
  var rO  ='res_ovr.gif'
  var tH  ='<font face=verdana size=1> ÐŒ Window title</font>'
  var tW  =' ÐŒ window title'
  var wB  ='#000000'
  var wBs ='#FFFFFF'
  var wBG ='#FF0000'
  var wBGs='#00FF00'
  var wNS ='toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0'
  var fSO ='scrolling=no noresize'
  var brd =b||0;
  var max =x||false;
  var min =m||false;
  var res =r||false;
  var tsz =20;
  return chromeless(u,n,W,H,X,Y,cU,cO,cL,mU,mO,xU,xO,rU,rO,tH,tW,wB,wBs,wBG,wBGs,wNS,fSO,brd,max,min,res,tsz)
}

function openIT2(u) {
  return chromeless(u,'rarewin',500,300,null,null,
         'close_up.gif','close_ovr.gif',
         'clock.gif',
         'min_up.gif','min_ovr.gif',
         'max_up.gif','max_ovr.gif',
         'res_up.gif','res_ovr.gif',
         '<font face=impact color=#f0f0f0 size=5> |||| THIS IS A TEST ||||</font>','||| WIN TEST',
         '#505050','#ffffff',
         '#707070','#707070',
         'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0','scrolling=no noresize',
         10,false,false,false,35)
}

</script> 
__________________________________________________________________________
To open the chromeless window, use this code:
<a href="#" onclick="mywindow=openIT('window.html',400,200,null,null,'mywindowname')">Open Chromeless</a>
'window.html' is the page you want to open in the window. 400 is the width in pixels of the window, 200 is the height. null means we want it to open in the center of the screen.
To customize the window, open up the graphics from the ZIP file in a graphics editing program and make them look how you want. Then edit the code you placed in the head of the document. This is what the different variables mean:
wB| Border color.
wBs| Border color on window drag.
wBG| Background of the title bar.
WBGs | Background of the title bar on window drag.
tH| Title for the title bar of the window.
tW| Title for the Windows task bar.
brd| Extra border size.
max| Maximize option (true|false).
min| Minimize to taskbar option (true|false).
res| Resizable window (true|false).
tsz| Height of title bar.
Please note that I cannot/will not provide support for chromeless windows. If it's not working, I'm afraid you'll have to ask somewhere else.

1 Comments:

Anonymous said...

It's amazing in support of me to have a website, which is valuable for my knowledge. thanks admin

Also visit my web-site: Http://Businesswebhostingproviders.Com/

Post a Comment