Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: 10 Minute Clock

  1. #1
    New to the CF scene
    Join Date
    Jan 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation 10 Minute Clock

    Has anyone got a script where an image (image 1) is on the screen at 12:00 and then 10 minutes later (12:10) image 2 comes up.

    I need a script where the image changes every 10 minutes depending on the time.

    Thanks
    Simon

  • #2
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    904
    Thanks
    0
    Thanked 118 Times in 117 Posts
    can image2 be a random picture or must it follow a specified order??

  • #3
    New to the CF scene
    Join Date
    Jan 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by lerura
    can image2 be a random picture or must it follow a specified order??
    Specified order.

  • #4
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    904
    Thanks
    0
    Thanked 118 Times in 117 Posts
    i guess this is what you want:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <title></title>
    <meta  http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <link rel="stylesheet" type="text/css" href="stylesheet.css" />
    <style type="text/css"><!--
    
    --></style>
    <script type="text/javascript" src="javascript.js"></script>
    <script type="text/javascript"><!--
    
    SwapImageID='Something'; //  ID of image to swap
    SwapImage=new Array();
    SwapImage[0]='xx00.gif'; //  shown from xx:00 to xx:10
    SwapImage[1]='xx10.gif'; //     -||-    xx:10 to xx:20
    SwapImage[2]='xx20.gif'; //     -||-    xx:20 to xx:30
    SwapImage[3]='xx30.gif'; //     -||-    xx:30 to xx:40
    SwapImage[4]='xx40.gif'; //     -||-    xx:40 to xx:50
    SwapImage[5]='xx50.gif'; //     -||-    xx:50 to xx:00
    
    function Swap(){
    x=new Date();
    M=x.getMinutes();
    Q=(M-(M%10))/10;
    document.getElementById(SwapImageID).src=SwapImage[Q];
    NextSwap=600000-x%600000;
    setTimeout('Swap()',NextSwap);
    }
    // --></script>
    </head>
    <body onload="Swap()">
    <img id="Something" />
    </body>
    </html>

  • #5
    New to the CF scene
    Join Date
    Jan 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by lerura
    i guess this is what you want:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <title></title>
    <meta  http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <link rel="stylesheet" type="text/css" href="stylesheet.css" />
    <style type="text/css"><!--
    
    --></style>
    <script type="text/javascript" src="javascript.js"></script>
    <script type="text/javascript"><!--
    
    SwapImageID='Something'; //  ID of image to swap
    SwapImage=new Array();
    SwapImage[0]='xx00.gif'; //  shown from xx:00 to xx:10
    SwapImage[1]='xx10.gif'; //     -||-    xx:10 to xx:20
    SwapImage[2]='xx20.gif'; //     -||-    xx:20 to xx:30
    SwapImage[3]='xx30.gif'; //     -||-    xx:30 to xx:40
    SwapImage[4]='xx40.gif'; //     -||-    xx:40 to xx:50
    SwapImage[5]='xx50.gif'; //     -||-    xx:50 to xx:00
    
    function Swap(){
    x=new Date();
    M=x.getMinutes();
    Q=(M-(M%10))/10;
    document.getElementById(SwapImageID).src=SwapImage[Q];
    NextSwap=600000-x%600000;
    setTimeout('Swap()',NextSwap);
    }
    // --></script>
    </head>
    <body onload="Swap()">
    <img id="Something" />
    </body>
    </html>
    Good script but i need it to last 1 week (10,080 mins) and I need a link on the pics.

    Thanks
    Simon

  • #6
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    904
    Thanks
    0
    Thanked 118 Times in 117 Posts
    ... and if each picture should only be shown once per week, it will become 1008 different pics in a week.

    if so the script will be HUGE since every combination of picture and link must be stored in an array. (i guess it will be 80k or more)

    if i should be able to help you further i need to know more about the looping sequence


  •  

    Posting Permissions

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