العربية
<!--مراجعة العناصر syeClock() { if (!document.layers && !document.all) return; timePortion = مصفوفة جديدة؛ maxLength = new Array; var runTime = new Date(); timePortion[0] = runTime.getHours(); timePortion[1] = runTime.getMinutes(); timePortion[2] = runTime.getSeconds(); maxLength[0] = 5; maxLength[1] = 6; maxLength[2] = 6; فار decValue = 0; فار decMod = 0; فار درجة الحرارة = ""; varhoursBackground = "#7B7BB5"; var MinuteBackground = "#4D5487"; فار ثانية الخلفية = "#424A63"; varcolonBackground = "#000000"; فار textColor = "#FFFFFF"; for (var curPor = 0; curPor <= 2; curPor++) { decValue = timePortion[curPor]; timePortion[curPor] = ""; while (decValue != 0) { decMod = decValue % 2; decValue = Math.floor(decValue / 2); timePortion[curPor] = decMod + timePortion[curPor]; } if (timePortion[curPor].length < maxLength[curPor]) { for (var i = 1; i <= maxLength[curPor] - timePortion[curPor].length; i++) { temp += "0"; } } timePortion[curPor] = temp + timePortion[curPor]; درجة الحرارة = ""; } Movingtime = '<table border="0" cellpadding="0" cellpacing="0"><tr><td bgcolor='+hoursBackground +'><font color='+ textColor +'>' + timePortion[0 ] + '</font></td><td bgcolor='+colonBackground +'>:</td><td bgcolor='+ MinuteBackground +'><font color='+ textColor +'>' + timePortion[ 1] + '</font></td><td bgcolor='+colonBackground +'>:</td><td bgcolor='+ ثوانيBackground +'><font color='+ textColor +'>' + timePortion [2] + '</font></td></tr></table>'; إذا (document.layers) { document.layers.clock.document.write(movingtime); document.layers.clock.document. Close(); } else if (document.all) { Clock.innerHTML = Movingtime; } setTimeout("syeClock()", 1000) } window.onload = syeClock; </script> <p align="center"> 二进制时钟<br> <span id="clock" style="position:relative;"></span> </p>