Javascript - Сложете часовник на сайта си
Искате да имате часовник на сайта си?Но,не знаете как?
Просто копнете този код:
<div style="position: absolute; left: 423px; top: 162px; width: 106px; height: 41px; z-index: 57;" align="left">
<font corsiva="" color="#000000" face="Monotype" size="2"><div id="basicclock"></div></font>

<script language="JavaScript">
<!-- Original: Xavier R. (xav@lougaou.com) -->
<!-- Modified: Benjamin Wright, Editor -->
<!-- Web Site: http://www.lougaou.com/ -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

function clock()
{
if (!document.layers && !document.all) return;
var digital = new Date();
var hours = digital.getHours();
var minutes = digital.getMinutes();
var seconds = digital.getSeconds();
var amOrPm = "AM";
if (hours > 11) amOrPm = "PM";
if (hours > 12) hours = hours - 12;
if (hours == 0) hours = 12;
if (minutes <= 9) minutes = "0" + minutes;
if (seconds <= 9) seconds = "0" + seconds;
dispTime = hours + ":" + minutes + ":" + seconds + " " + amOrPm;
if (document.layers) {
document.layers.basicclock.document.write(dispTime);
document.layers.basicclock.document.close();
}
else
if (document.all)
basicclock.innerHTML = dispTime;
setTimeout("clock()", 1000);
}

clock();

</script>

</div>

Урока е подготвен от asi_a

Ето и ДЕМО



/ Трябва да сте регистриран за да напишете коментар /
От: kristiqn2
11:25 29-06-2010
1-vo demoto ne raboti
2-ro ne mi izliza nikakav 4asovnik
1