»
Tiếng AnhTiếng PhápTiếng Việt

In - Đồng hồ hệ 16 - JavaScriptBank.com

Phiên bản đầy đủ: jsB@nk » Thời gian » Đồng hồ » Đồng hồ hệ 16
URL: https://www.javascriptbank.com/hexadecimal-clock-script.html

Đồng hồ hệ 16 © JavaScriptBank.comHiệu ứng tạo một đồng hồ trên trang web với các con số được hiển thị ở hệ 16.

Phiên bản đầy đủ: jsB@nk » Thời gian » Đồng hồ » Đồng hồ hệ 16
URL: https://www.javascriptbank.com/hexadecimal-clock-script.html



JavaScript
<script language="javascript">var hexclk;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(hexclk, 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){nbr=nbr.toString(16);while(nbr.length!=2)nbr='0'+nbr;return nbr;}window.onload=function(){hexclk=(ns4)?document.layers['hexclk']:(ie4)?document.all['hexclk']:document.getElementById('hexclk');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-->


HTML
<table cellpadding="0" cellspacing="0" border="0"><tr><td align="center" width="300"><div id="hexclk" 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-->