WEB Where to get a countdown clock?

Discussion in 'OT Technology' started by carlo2343, Nov 28, 2009.

  1. carlo2343

    carlo2343 New Member

    Joined:
    Jul 20, 2005
    Messages:
    6,443
    Likes Received:
    0
  2. thomor25

    thomor25 I make money online....

    Joined:
    Jun 11, 2000
    Messages:
    11,101
    Likes Received:
    0
    Location:
    Denver Colorado
    I love it when i get inspired
     
  3. carlo2343

    carlo2343 New Member

    Joined:
    Jul 20, 2005
    Messages:
    6,443
    Likes Received:
    0
    I'm not much of a coder per se...how do I go about taking theirs?
     
  4. Major Tom

    Major Tom OT Supporter

    Joined:
    Mar 10, 2003
    Messages:
    5,683
    Likes Received:
    0
    Location:
    England
  5. Ricky

    Ricky █▄ █▄█ █▄ ▀█▄

    Joined:
    Jun 17, 2005
    Messages:
    38,767
    Likes Received:
    6
    google.com
     
  6. Insert Tokens

    Insert Tokens Making Cancer My Bitch OT Supporter

    Joined:
    Jan 12, 2006
    Messages:
    8,329
    Likes Received:
    75
    Location:
    Tasmania
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html dir="ltr" lang="en"> 
    <head> 
    
    <script type="text/javascript">
    function StartCountDown(myDiv,myTargetDate){
    	var dthen	= new Date(myTargetDate);
    	var dnow	= new Date();
    	ddiff		= new Date(dthen-dnow);
    	gsecs		= Math.floor(ddiff.valueOf()/1000);
    	CountBack(myDiv,gsecs);
    }
    
    function Calcage(secs, num1, num2){
    	s = ((Math.floor(secs/num1))%num2).toString();
    	if (s.length < 2){	
    		s = "0" + s;
    	}
    	return (s);
    }
    
    function CountBack(myDiv, secs){
    	var DisplayStr;
    	
    	if(Calcage(secs,86400,100000) > 0){
    		var DisplayFormat = "%%D%% Days %%H%%:%%M%%:%%S%%";
    	} else {
    		var DisplayFormat = "%%H%%:%%M%%:%%S%%";
    	}
    	DisplayStr = DisplayFormat.replace(/%%D%%/g,	Calcage(secs,86400,100000));
    	DisplayStr = DisplayStr.replace(/%%H%%/g,		Calcage(secs,3600,24));
    	DisplayStr = DisplayStr.replace(/%%M%%/g,		Calcage(secs,60,60));
    	DisplayStr = DisplayStr.replace(/%%S%%/g,		Calcage(secs,1,60));
    	if(secs > 0){	
    		document.getElementById(myDiv).innerHTML = DisplayStr;
    		setTimeout("CountBack('" + myDiv + "'," + (secs-1) + ");", 990);
    	}else{
    		document.getElementById(myDiv).innerHTML = "Please refresh the page...";
    		//window.location.reload();
    	}
    }
    
    </script>
    
    </head>
    <body>
    
    <div id="countdown">Countdown will be here..</div>
    
    <script type="text/javascript">StartCountDown("countdown","02/14/2010 04:00 PM");</script>
    
    </body>
    </html>
    
     
  7. carlo2343

    carlo2343 New Member

    Joined:
    Jul 20, 2005
    Messages:
    6,443
    Likes Received:
    0
    dumpy ftw...the timer is fully functional, thank you man.
     
  8. Insert Tokens

    Insert Tokens Making Cancer My Bitch OT Supporter

    Joined:
    Jan 12, 2006
    Messages:
    8,329
    Likes Received:
    75
    Location:
    Tasmania
    That's heaps better.. *steals*.. i mean.. *gets inspired*.. ;)
     

Share This Page