Psycho3D
10-25-2012, 04:23 PM
Hey everyone I have a thing on a website I'm working on. We will be counting down from October 29 to Nov 23 and I want a new tip to apear on each da. It needs to change on midnight of each day. Are there any good tickers out there that I can edit it to change every 24 hours?
bernie1227
10-25-2012, 07:32 PM
http://www.mikesdotnetting.com/Article/32/Javascript-24-hour-clock?
Psycho3D
10-25-2012, 08:04 PM
Thank you, but I need more than just a clock. I need it to change the tip of the day at midnight of everyday via XML or txt.
Psycho3D
10-25-2012, 08:14 PM
I guesws to be a little clearer it is more like a countdown clock, but when the day changes it displays a new tip of the day.
jscheuer1
10-25-2012, 09:20 PM
Look here:
http://www.dynamicdrive.com/search/search.php?zoom_query=daily&zoom_per_page=10&zoom_and=1&zoom_sort=0&x=0&y=0
vwphillips
10-26-2012, 12:53 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
</head>
<body>
<div id="tst" ></div>
<script type="text/javascript">
/*<![CDATA[*/
// Tip of the Day (26=October-2012)
// by Vic Phillips - http://www.vicsjavascripts.org.uk/
function zxcTipOfTheDay(o){
var id=o.ID,tips=o.Tips,now=new Date(),y=now.getFullYear(),m=now.getMonth(),d=now.getDate(),nu=0,c=false,re=new RegExp(id+'='+'[^;]+','i');
if (document.cookie.match(re)){
c=document.cookie.match(re)[0].split("=")[1];
}
if (c){
c=c.split(',');
if (y!=c[0]*1||m!=c[1]*1||d!=c[2]*1){
nu=++c[3]%tips.length;
}
}
document.getElementById(id).innerHTML=tips[nu];
document.cookie=id+'='+y+','+m+','+d+','+nu+';expires='+(new Date(new Date().getTime()+864000000).toGMTString())+';path=/';
}
zxcTipOfTheDay({
ID:'tst',
Tips:[
'Tip 1',
'Tip 2',
'Tip 3',
'Tip 4',
'Tip 5'
]
});
/*]]>*/
</script>
</body>
</html>
simpler
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
</head>
<body>
<div id="tst" ></div>
<script type="text/javascript">
/*<![CDATA[*/
// Tip of the Day (26=October-2012)
// by Vic Phillips - http://www.vicsjavascripts.org.uk/
function zxcTipOfTheDay(o){
var id=o.ID,tips=o.Tips,now=Math.floor(new Date().getTime()/86400000),nu=0,c=false,re=new RegExp(id+'='+'[^;]+','i');
if (document.cookie.match(re)){
c=document.cookie.match(re)[0].split("=")[1].split(',');
if (now-c[0]>0){
nu=++c[1]%tips.length;
}
}
document.getElementById(id).innerHTML=tips[nu];
document.cookie=id+'='+now+','+nu+';expires='+(new Date(new Date().getTime()+864000000).toGMTString())+';path=/';
}
zxcTipOfTheDay({
ID:'tst',
Tips:[
'Tip 1',
'Tip 2',
'Tip 3',
'Tip 4',
'Tip 5'
]
});
/*]]>*/
</script>
</body>
</html>
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.