»
EnglishFrenchVietnamese

Print - Display countdown timer before redirecting - JavaScriptBank.com

Full version: jsB@nk » Browser » Window » Display countdown timer before redirecting
URL: https://www.javascriptbank.com/display-countdown-timer-before-redirecting.html

Display countdown timer before redirecting © JavaScriptBank.comThis JavaScript will display a countdown timer in the small different window before redirecting you to another URL. Every second passes then background of the main page changed. Here in example, timer was set 5 seconds.

Full version: jsB@nk » Browser » Window » Display countdown timer before redirecting
URL: https://www.javascriptbank.com/display-countdown-timer-before-redirecting.html



JavaScript
<SCRIPT language=JavaScript><!--var nextpage = 'http://javascriptbank.com'; function countdown5(){count = open('', 'wait', 'width=100,height=100,toolbar=no,menubar=no,status=no');count.document.open();count.document.write('<html><head><title>5</title></head><body>');count.document.write('<font size="7">');count.document.write('<center><b>5</b></center>');count.document.write('</font></body></html>');}function countdown4(){count = open('', 'wait', 'width=100,height=100,toolbar=no,menubar=no,status=no');count.document.open();count.document.write('<html><head><title>4</title></head><body>');count.document.write('<font size="7">');count.document.write('<center><b>4</b></center>');count.document.write('</font></body></html>');}function countdown3(){count = open('', 'wait', 'width=100,height=100,toolbar=no,menubar=no,status=no');count.document.open();count.document.write('<html><head><title>3</title></head><body>');count.document.write('<font size="7">');count.document.write('<center><b>3</b></center>'); count.document.write('</font></body></html>');}function countdown2(){count = open('', 'wait', 'width=100,height=100,toolbar=no,menubar=no,status=no');count.document.open();count.document.write('<html><head><title>2</title></head><body>');count.document.write('<font size="7">');count.document.write('<center><b>2</b></center>'); count.document.write('</font></body></html>');}function countdown1(){count = open('', 'wait', 'width=100,height=100,toolbar=no,menubar=no,status=no');count.document.open();count.document.write('<html><head><title>1</title></head><body>');count.document.write('<font size="7">');count.document.write('<center><b>1</b></center>'); count.document.write('</font></body></html>');}function countdown0(){count = open('', 'wait', 'width=100,height=100,toolbar=no,menubar=no,status=no');count.document.open();count.document.write('<html><head><title>0</title></head><body>');count.document.write('<font size="7">');count.document.write('<center><b>0</b></center>'); count.document.write('</font></body></html>');count.document.close();}function zero(){count.close()}function link(){location.href = nextpage;}function timer(){setTimeout("countdown5()", 1000);setTimeout("countdown4()", 2500);setTimeout("countdown3(),document.bgColor='999999'", 4000); setTimeout("countdown2(),document.bgColor='666666'", 5500);setTimeout("countdown1(),document.bgColor='333333'", 7000);setTimeout("countdown0(),document.bgColor='000000'", 8500); setTimeout("zero()", 10000);setTimeout("link()", 10025); }//--></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<BODY onload=timer()></BODY><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->