Final4Ever Community
Your Ad Here

Go Back   Final4Ever Community > Final4Ever Community > Web Templates, Programming Language, Scripts & E-Books > Scripts, Fonts, Wallpapers & Icons
Scripts, Fonts, Wallpapers & Icons VBulletin, PhpBB, Invision Board Skins, Templates and Hacks

Donation Goal
Goal amount for this month: 200 EUR, Received: 0 EUR (0%)
Donate Now

Direct download JavaScript Countdown Timer here
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12th October 2009, 18:21
Leecher
 
Join Date: Sep 2009
Posts: 7
Default JavaScript Countdown Timer

This JavaScript displays a countdown timer and alerts the user when the timer reaches zero. It then redirects to another Web ... detail


How to setup

Step 1: Place CSS below in your HEAD section
CSS
Code:
<style type="text/css">
#txt {
  border:none;
  font-family:verdana;
  font-size:16pt;
  font-weight:bold;
  border-right-color:#FFFFFF
}

</style>
	<!--
    	This script downloaded from www.JavaScriptBank.com
    	Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
	-->
Step 2: Use JavaScript code below to setup the script
JavaScript
Code:
<script language="javascript">
// Created by: Neill Broderick :: http://www.bespoke-software-solutions.co.uk/downloads/downjs.php

var mins
var secs;

function cd() {
 	mins = 1 * m("10"); // change minutes here
 	secs = 0 + s(":01"); // change seconds here (always add an additional second to your total)
 	redo();
}

function m(obj) {
 	for(var i = 0; i < obj.length; i++) {
  		if(obj.substring(i, i + 1) == ":")
  		break;
 	}
 	return(obj.substring(0, i));
}

function s(obj) {
 	for(var i = 0; i < obj.length; i++) {
  		if(obj.substring(i, i + 1) == ":")
  		break;
 	}
 	return(obj.substring(i + 1, obj.length));
}

function dis(mins,secs) {
 	var disp;
 	if(mins <= 9) {
  		disp = " 0";
 	} else {
  		disp = " ";
 	}
 	disp += mins + ":";
 	if(secs <= 9) {
  		disp += "0" + secs;
 	} else {
  		disp += secs;
 	}
 	return(disp);
}

function redo() {
 	secs--;
 	if(secs == -1) {
  		secs = 59;
  		mins--;
 	}
 	document.cd.disp.value = dis(mins,secs); // setup additional displays here.
 	if((mins == 0) && (secs == 0)) {
  		window.alert("Time is up. Press OK to continue."); // change timeout message as required
  		// window.location = "yourpage.htm" // redirects to specified page once timer ends and ok button is pressed
 	} else {
 		cd = setTimeout("redo()",1000);
 	}
}

function init() {
  cd();
}
window.onload = init;
</script>
	<!--
    	This script downloaded from www.JavaScriptBank.com
    	Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
	-->
Step 3: Place HTML below in your BODY section
HTML
Code:
<form name="cd">
<input id="txt" readonly="true" type="text" value="10:00" border="0" name="disp">
</form>
	<!--
    	This script downloaded from www.JavaScriptBank.com
    	Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
	-->





Reply With Quote
Reply

Bookmarks

Tags
countdown , javascript , timer

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Goodnight Timer regman Applications 0 27th April 2009 23:21
Shutdown Timer Express v1.0.3 regman Applications 0 23rd March 2009 19:07
Multi Timer Ultimate v2.42 regman Applications 0 1st December 2008 22:37
Shutdown Timer 1.0.2 regman Applications 0 22nd October 2008 08:33

Your Ad Here

All times are GMT +2. The time now is 12:17.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Final4Ever Forums  |   PhazeDDL.com  |   AdultShare.org  |   Final4Ever.co.uk  |   F4E.info  |   HellDDL.com