.

Часы.

Данный скрипт реализует часы (надписи выделенные зеленым необходимо откорректировать). Вставьте в тег <body … onLoad="clockon()">.
 

Код.

<script language="JavaScript">
<!--
function clockon() {
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}
thistime = hours + ":" + minutes + ":" + seconds
if (document.all) {
bgclocknoshade.innerHTML = thistime
bgclockshade.innerHTML = thistime
}
if (document.layers) {
document.bgclockshade.document.write ('<div id = "bgclockshade" style = " position:absolute; visibility:visible; font-family:Arial,sans-serif; color:#cccccc; font-size:30px; top:155px; left:152px">' +thistime+ '</div>')
document.bgclocknoshade.document.write ('<div id = "bgclocknoshade" style = "position:absolute; visibility:visible; font-family:Arial,sans-serif; color:#000000; font-size:30px; top:150px; left:150px">' +thistime+ '</div>')
document.close()
}
var timer=setTimeout ("clockon()", 200)
}
//-->
</script>

<div id="bgclockshade" style="position: absolute; visibility: visible; font-family: Arial,sans-serif; color: #cccccc; font-size: 30px; top: 155px; left: 152px">
</div>
<div id="bgclocknoshade" style="position: absolute; visibility: visible; font-family: Arial,sans-serif; color: #000000; font-size: 30px; top: 150px; left: 150px">
</div>
<div id="mainbody" style="position: absolute; visibility: visible">
</div>

 

Результат.

Посмотрите вверху страницы
 

Назад