Advanced Search

Results 1 to 6 of 6

Thread: looking for a ticker that changes every 24 hours.

  1. #1
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default looking for a ticker that changes every 24 hours.

    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?

  2. #2
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    47
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  3. #3
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  4. #4
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,701
    Thanks
    43
    Thanked 3,133 Times in 3,097 Posts
    Blog Entries
    12

    Default

    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,707
    Thanks
    2
    Thanked 388 Times in 383 Posts

    Default

    Code:
    <!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

    Code:
    <!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>
    Last edited by vwphillips; 10-26-2012 at 03:58 PM.
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

Similar Threads

  1. Php time 2 hours different
    By keyboard in forum PHP
    Replies: 7
    Last Post: 04-22-2012, 08:20 AM
  2. DATETIME Format in 12 Hours
    By newphpcoder in forum PHP
    Replies: 0
    Last Post: 10-24-2011, 01:19 AM
  3. cache only for 8 hours
    By yitschak in forum Looking for such a script or service
    Replies: 9
    Last Post: 08-09-2010, 10:38 AM
  4. Been at this for 12 hours Lightbox please help
    By Wizzap in forum JavaScript
    Replies: 23
    Last Post: 03-19-2008, 02:18 AM
  5. Live date in 24 hours?
    By babylon in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 01-06-2006, 01:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •