»
EnglishFrenchVietnamese

Print - Inline clock: fits anywhere into any text - JavaScriptBank.com

Full version: jsB@nk » Time » Clock » Inline clock: fits anywhere into any text
URL: https://www.javascriptbank.com/inline-clock-fits-anywhere-into-any-text.html

Inline clock: fits anywhere into any text © JavaScriptBank.comThis is the first dynamic clock that smoothly fits anywhere into your text. The clock automatically adapts itself to the surrounding font, fontcolor and fontsize (NO configuration required). Special feature: you may put as many clocks into your text as you like.

Full version: jsB@nk » Time » Clock » Inline clock: fits anywhere into any text
URL: https://www.javascriptbank.com/inline-clock-fits-anywhere-into-any-text.html



JavaScript
<script>// Inline clock: fits anywhere into any textvar clockid=new Array()var clockidoutside=new Array()var i_clock=-1var thistime= new Date()var hours=thistime.getHours()var minutes=thistime.getMinutes()var seconds=thistime.getSeconds()if (eval(hours) <10) {hours="0"+hours}if (eval(minutes) < 10) {minutes="0"+minutes}if (seconds < 10) {seconds="0"+seconds}var thistime = hours+":"+minutes+":"+secondsfunction writeclock() {i_clock++if (document.all || document.getElementById || document.layers) {clockid[i_clock]="clock"+i_clockdocument.write("<span id='"+clockid[i_clock]+"' style='position:relative'>"+thistime+"</span>")}}function clockon() {thistime= new Date()hours=thistime.getHours()minutes=thistime.getMinutes()seconds=thistime.getSeconds()if (eval(hours) <10) {hours="0"+hours}if (eval(minutes) < 10) {minutes="0"+minutes}if (seconds < 10) {seconds="0"+seconds}thistime = hours+":"+minutes+":"+secondsif (document.all) {for (i=0;i<=clockid.length-1;i++) {var thisclock=eval(clockid[i])thisclock.innerHTML=thistime}}if (document.getElementById) {for (i=0;i<=clockid.length-1;i++) {document.getElementById(clockid[i]).innerHTML=thistime}}var timer=setTimeout("clockon()",1000)}window.onload=clockon</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<script>writeclock()</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->