close window button

L

Louis

Hello,
I was looking at some websites and they have a close window button.
Does anyone know how. If html please explain. I am just learning. Frontpage
2002 Windows XP.
Thanks,
Louis Johnson
 
K

Kevin Spencer

<input type="button" value="Click Me" onclick="window.opener = self;
window.close()">

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
T

Tom Pepper Willett

<a href="javascript:window.close();">Close Window</a>
--
===
Tom "Pepper" Willett
Microsoft MVP - FrontPage
---
About FrontPage 2003:
http://office.microsoft.com/home/office.aspx?assetid=FX01085802
FrontPage 2003 Product Information:
http://www.microsoft.com/office/frontpage/prodinfo/default.mspx
Understanding FrontPage:
http://msdn.microsoft.com/office/understanding/frontpage/
FrontPage 2002 Server Extensions Support Center:
http://support.microsoft.com/default.aspx?scid=fh;en-us;fp10se
===
| Hello,
| I was looking at some websites and they have a close window button.
| Does anyone know how. If html please explain. I am just learning.
Frontpage
| 2002 Windows XP.
| Thanks,
| Louis Johnson
 
T

Trevor L.

I am trying to automatically close a window after a short delay and this
posting seemed to be relevant

I am opening a window using an onclick which calls Javascript

<a href="images/family-pictures.jpg"
onclick="OpenWindow('images/family-pictures.jpg','Image1');return
false;">
<img src="images/thumbnails/family-pictures.jpg" alt=""></a>

function OpenWindow(ImgName,ImgNo)
{
spawnJimcoPopup
(ImgName,ImgNo,
'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes',
'400','640','0','0','pixel');
return false;

myTimer=setTimeout("window." + ImgName + ".close()",5000);
}

function spawnJimcoPopup(url, name, options, h, w, x, y, scaleType)
{
var windowOptions;
if (scaleType == 'percent')
{ w = (w * screen.availWidth) / 100;
h = (h * screen.availHeight) / 100; }

if (x == 'center')
{ x = (screen.availWidth - w) / 2;
y = (screen.availHeight - h) / 2; }

windowOptions = options + ',width=' + w + ',height=' + h + ',left=' + x +
',top=' + y;
newWindow = window.open(url, name, windowOptions);
newWindow.focus();
}


The function spawnJimcoPopup works perfectly (of course) but the timeout
does not. I want to display the new window for 5 seconds and then have it
close automatically, but nothing happens.

I am sure there is something wrong with the call to the setTimeout function
but I can't see what

All help appreciated
--
Cheers,
Trevor L.


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
Top