DevHunters.com l Webmaster Forum - Web Advertising - Web Design - SEO Forums  

Go Back   DevHunters.com l Webmaster Forum - Web Advertising - Web Design - SEO Forums > Webmaster / Coding / Web Design Discussion > JavaScript Programming

JavaScript Programming Discuss javascript coding.

Have A Look At Some Of Our Webmaster Related Sponsors!


Script Directory


Shopping Cart


Market Leverage


Free Templates

3D Guide-Characters
3D Guide-characters

social bookmarking network
Advertise Here

Reply
 
LinkBack Thread Tools Display Modes
Old 02-20-2008, 08:33 AM   #1 (permalink)
New Hunter
 

Join Date: Feb 2008
Posts: 1
iTrader: 0 / 0%
Hunter Bux: 0
wa4mth is on a distinguished road
Default How To Make A Counter Count Up By 10

I need to make a counter that will count up by 10 per second and will run continually for a week. I need the output to be big so it can be seen well and i need it to be big enough for the results so at least 9 places. Any Ideas would be greatly appreciated.
Thanks
wa4mth is offline   Reply With Quote
Old 02-20-2008, 10:47 AM   #2 (permalink)
New Hunter
 

Join Date: Dec 2007
Location: United Kingdom - Dorset - Bournemouth
Posts: 87
iTrader: 0 / 0%
Hunter Bux: 5.00
Smiggy will become famous soon enoughSmiggy will become famous soon enough
Send a message via MSN to Smiggy
Default

Code:
<script>
	var x = new Date();
	var day = x.getDay();
	var end_day;
	var y = 0;
function start()
{
	var end_day = day + 7;
	if(end_day > 7)
		{
		var end_day = end_day - 7;
		}
	if(end_day == 0){ var end = "Monday"; }
	if(end_day == 1){ var end = "Teusday"; }
	if(end_day == 2){ var end = "Wednesday"; }
	if(end_day == 3){ var end = "Thursday"; }
	if(end_day == 4){ var end = "Friday"; }
	if(end_day == 5){ var end = "Saturday"; }
	if(end_day == 6){ var end = "Sunday"; }
	count();
	document.getElementById('end').innerHTML = end;
}

function count()
{
	if(end_day == day)
		{
		document.getElementById('count').innerHTML = "After 7 day, the count got to " + y;
		}else{
		Object = document.getElementById('count');
		y = y + 10;
		Object.innerHTML = y;
			setTimeout("count()", 1000);
		}
}
</script>
<a onClick="start()">Begin Count</a><br />
<br />
<br />
<div id="count"></div>
<br />
It will end on <div id="end"></div>
Dunno if this is what you are looking for.
Smiggy is offline   Reply With Quote
Reply

Bookmarks

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



All times are GMT -5. The time now is 12:53 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
vBCredits v1.4 Copyright ©2007, PixelFX Studios