Phiên bản đầy đủ: jsB@nk » Thời gian » Đồng hồ » Đồng hồ nhị phân
URL: https://www.javascriptbank.com/bcd-clock-script.html
Hiệu ứng tạo một đồng hồ số với thời gian được hiển thị qua số nhị phân.
Phiên bản đầy đủ: jsB@nk » Thời gian » Đồng hồ » Đồng hồ nhị phân
URL: https://www.javascriptbank.com/bcd-clock-script.html
<script language="javascript">var binclk;var now;var ns4 = (document.layers)? true : false;var ie4 = (document.all && !document.getElementById)? true : false;var ns6 = (document.getElementById && navigator.appName.indexOf("Netscape")>=0 )? true: false;function setclock(){now=new Date();var txt=getstring(now.getHours()+'')+' : '+getstring(now.getMinutes()+'')+' : '+getstring(now.getSeconds()+'');if(ns4) txt='<div style="position:absolute; top:0px; left:0px"><center><b>'+txt+'</b></center></div>'; writeid(binclk, txt);}function writeid(id,text){if(ns4){id.document.open();id.document.write('<div style="position:absolute; left:0px; top:0px;">'+text+'</div>');id.document.close();}else id.innerHTML=text;}function getstring(nbr){while(nbr.length<2) nbr='0'+nbr;nbr=nbr.split('');nbr[0]=eval(nbr[0]).toString(2);nbr[1]=eval(nbr[1]).toString(2);while(nbr[0].length<4) nbr[0]='0'+nbr[0];while(nbr[1].length<4) nbr[1]='0'+nbr[1];return nbr[0]+','+nbr[1];}window.onload=function(){ binclk=(ns4)? document.layers['binclk']:(ie4)?document.all['binclk']:document.getElementById('binclk'); setInterval('setclock()', 300);}window.onresize=function(){if(ns4)setTimeout('history.go(0)', 400);}</script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<table cellpadding="0" cellspacing="0" border="0"><tr><td align="center" width="300"><div id="binclk" style="position:relative; width:300px; height:25px; font-weight:bold"></div></td></tr></table><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->