Multilingual SEO Forums by WebCertain

Go Back   Multilingual SEO Forums by WebCertain > Multilingual SEO Issues > Soapbox
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Soapbox Get on your 'soapbox' and shout! All the stuff which doesn't fit anywhere else

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-01-08, 11:03 AM
Liam Billington Liam Billington is offline
Web Certain - Keywords & Research - Moderator
 
Join Date: Sep 2007
Native Country: England
Posts: 57
Liam Billington is on a distinguished road
Send a message via MSN to Liam Billington
Default Web Counter

Hello there. A little help needed web dev wise. A charity which I help out with when I am back home has asked me last night about a counter which will automatically add up a figure constantly like these ones you see for the cost of war.

Are there any websites around which will allow you to input the figures and then spew out some javascript code or are there any tutorials around to create one yourself.

Thanks for your help and time. It will be greatly appreciated.

Liam
Reply With Quote
  #2 (permalink)  
Old 11-01-08, 02:25 PM
Peter Kersbergen's Avatar
Peter Kersbergen Peter Kersbergen is offline
 
Join Date: May 2007
Native Country: The Netherlands
Posts: 43
Peter Kersbergen is on a distinguished road
Default

An example from The JavaScript Planet - Collection with 371 free JavaScripts! - you should be able to work out how to adapt this to your own page.
Make a Javascript function & relevant html code to call on the function - it's quite straight forward.


Code:
<HTML>

<HEAD>

<title>People on the Earth</title>

</head>

<BODY BGCOLOR="#FFFFFF" onLoad="maind()">

<center></center><A HREF="jv_main.html"><IMG SRC="java.gif" ALT="Back to JS main page" width=33 height=33 border=0></A><P>
BY:<a href="mailto:w.joosen@tip.nl">w.joosen@tip.nl</a>...<a href="http://www.geocities.com/SiliconValley/Heights/7725/" target="_top">Homepage</a><br>
DATE:1997-03-24<BR>
<hr>
<script language="JavaScript">



function maind()

{

	startdate = new Date()

	now(startdate.getYear(),startdate.getMonth(),startdate.getDate(),startdate.getHours(),startdate.getMinutes(),startdate.getSeconds())

}



function ChangeValue(number,pv)

{

	numberstring =""

	var j=0 

	var i=0

	while (number > 1)

	 { 

	    numberstring = (Math.round(number-0.5) % 10) + numberstring

	    number= number / 10

	    j++

	    if (number > 1 && j==3) { 

			numberstring = "." + numberstring 

			j=0}

	    i++

	 }

	 numberstring= " " + numberstring+",00"

   

 

	if (pv==1) { document.schuld.schuld.value = numberstring }

	if (pv==2) {document.newnow.newnow.value = numberstring}



}

	

function now(year,month,date,hours,minutes,seconds) 

{       

	startdatum = new Date(year,month,date,hours,minutes,seconds)



	var now = 5700000000.0

	var now2 = 5790000000.0

	var groeipercentage = (now2 - now) / now *100

	var groeiperseconde = (now * (groeipercentage/100))/365.0/24.0/60.0/60.0 

	nu = new Date ()                

	schuldstartdatum = new Date (96,1,1)                            

	secondenoppagina = (nu.getTime() - startdatum.getTime())/1000

	totaleschuld= (nu.getTime() - schuldstartdatum.getTime())/1000*groeiperseconde + now

	

	ChangeValue(totaleschuld,1);

	ChangeValue(secondenoppagina*groeiperseconde,2);



	timerID = setTimeout("now(startdatum.getYear(),startdatum.getMonth(),startdatum.getDate(),startdatum.getHours(),startdatum.getMinutes(),startdatum.getSeconds())",200)

}

</script>



<CENTER>

<BR>

<H2>The number of people on the planet Earth is now...</H2>

<form name="schuld">

<input type="text" name="schuld" size=25 value="">

 </FORM>

<BR><BR>

<H2>Since you are on this page the number of people on Earth has grown with

...</H2>

<form name="newnow">

<input type="text" name="newnow" size=25 value=""><H2> people</H2>

</FORM>

</CENTER>

</BODY>
</HTML>
Reply With Quote
  #3 (permalink)  
Old 17-01-08, 02:09 PM
Liam Billington Liam Billington is offline
Web Certain - Keywords &amp; Research - Moderator
 
Join Date: Sep 2007
Native Country: England
Posts: 57
Liam Billington is on a distinguished road
Send a message via MSN to Liam Billington
Default

Thank you Peter. You can see it over at No Mottram Bypass. You can see how much this bypass has cost up to the second. We are having problems with the counter working in IE, but it works a charm under Firefox.
Reply With Quote
Reply



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

vB 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 +1. The time now is 09:41 PM.


Copyright © 2007 Web Certain Europe Ltd

Search Engine Friendly URLs by vBSEO 3.0.0