automatic window closer

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   automatic window closer
GoddsEgo
PayPal Donation
CZ Moderator
Status: Offline
Joined: Jun 26, 2003
0.15 posts per day
Posts: 1211
Points: 69,166
 Yahoo Messenger  
Hi ALL.

I am trying to find a way to close a window automaticly after a given set of time.

Would their be a script for that or is there a meta tag that would do it?


Rob



Back to top Reply with quote
#2   re: automatic window closer
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
<script language="JavaScript">
// Set the following variable to the number of seconds the browser
// will wait before closing the window.
var gWindowCloseWait = 5;

function SetupWindowClose()
{
   window.setTimeout("window.close()",gWindowCloseWait*1000);
}

// Body onload utility (supports multiple onload functions)
var gSafeOnload = new Array();
function SafeAddOnload(f)
{
   isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
   IEmac = ((document.all)&&(isMac)) ? true : false;
   IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
   if (IEmac && IE4)  // IE 4.5 blows out on testing window.onload
   {
      window.onload = SafeOnload;
      gSafeOnload[gSafeOnload.length] = f;
   }
   else if  (window.onload)
   {
      if (window.onload != SafeOnload)
      {
         gSafeOnload[0] = window.onload;
         window.onload = SafeOnload;
      }      
      gSafeOnload[gSafeOnload.length] = f;
   }
   else
      window.onload = f;
}
function SafeOnload()
{
   for (var i=0;i<gSafeOnload.length;i++)
      gSafeOnload[i]();
}

// Call the following with your function as the argument
SafeAddOnload(SetupWindowClose);

</script>




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: automatic window closer
GoddsEgo
PayPal Donation
CZ Moderator
Status: Offline
Joined: Jun 26, 2003
0.15 posts per day
Posts: 1211
Points: 69,166
 Yahoo Messenger  
kewl ty telli



Back to top Reply with quote
#4   re: automatic window closer
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
Your quite welcome.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum