< p id = "txthour" > # </p>: < p id = "txtmin" > # </p>: < p id = "txtsec" > # </p>
< div id = "container" >
< div id = "sec" > </div>
< div id = "min" > </div>
< div id = "hour" > </div>
</div>
< script type = "text/javascript" >
clock ();
</script>
To the CSS section
Your format for the “kim” hours, minutes, seconds, frames containing:
Code:
function clock () {
var d = new Date ();
var s = d. getSeconds ();
var m = d. getMinutes ();
var h = d. getHours ();
$ ("#sec") .CSS ("width", s * 300/60 + "px");
$ ("#min") .CSS ("width", m * 300/60 + "px");
$ ("#hour") .CSS ("width", h * 300/24 + "px");
$ ("#txthour") .html (h);
$ ("#txtmin") .html (m);
$ ("#txtsec") .html (s);
setTimeout ("clock ()", 1000);
}
We split according to maximum rate of 60 minutes at the time, 12/24 kim, 60 seconds are the same length.
Use the setTimeout function to call main recursively on function and assign the length for the needle.
Welcome to the forums. I have for the moment unlisted your topic as I cannot see that there is a question.
As these are discussion forums this is more suited to a personal blog than the forums, unless you’re asking for help in getting the script to work - I’ve not tried it so I don’t know if it is working - or if you have a question.