JavaScript Source Code 3000: Clocks: Dynamic Clock
Dynamic Clock
(Version 4.0+ browsers) Using layers, JavaScript can display a real-time clock your page. This is a really professional way to add that special touch to your web page. And, watch as the clock on your page updates every second. All done without using forms, cool!
Currently, it's
JavaScript Source Code 3000: Clocks: Dynamic Clock
Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Apple-s). The script is yours!!!
<!-- TWO STEPS TO INSTALL DYNAMIC CLOCK:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Craig Lumley -->
<!-- Web Site: http://www.ws4all.co.uk -->
<! >
<! >
<!-- Begin
function MakeArrayday(size) {
this.length = size;
for(var i = 1; i <= size; i++) {
this[i] = "";
}
return this;
}
function MakeArraymonth(size) {
this.length = size;
for(var i = 1; i <= size; i++) {
this[i] = "";
}
return this;
}
function funClock() {
if (!document.layers && !document.all)
return;
var runTime = new Date();
var hours = runTime.getHours();
var minutes = runTime.getMinutes();
var seconds = runTime.getSeconds();
var dn = "AM";
if (hours >= 12) {
dn = "PM";
hours = hours - 12;
}
if (hours == 0) {
hours = 12;
}
if (minutes <= 9) {
minutes = "0" + minutes;
}
if (seconds <= 9) {
seconds = "0" + seconds;
}
movingtime = "<b>"+ hours + ":" + minutes + ":" + seconds + " " + dn + "</b>";
if (document.layers) {
document.layers.clock.document.write(movingtime);
document.layers.clock.document.close();
}
else if (document.all) {
clock.innerHTML = movingtime;
}
setTimeout("funClock()", 1000)
}
window.onload = funClock;
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
Currently, it's <span id=clock style="position:relative;"></span>
<!-- Script Size: 1.66 KB -->
Wyszukiwarka
Podobne podstrony:
Blaupunkt CR5WH Alarm Clock Radio instrukcja EN i PL2 Dynamika cz1,Modelowanie i symulacja systemów, Model dynamicznyTHE CLOCK zegar telling the time podawanie godzin i cwiczeniaCLOCK (2)Kinematyka i Dynamika Układów MechatronicznychC w6 zmienne dynamiczne wskazniki funkcji7 Dynamika ruchu obrotowego bryly sztywnejPHP6 i MySQL 5 Dynamiczne strony WWW Szybki start ph6ms5Dynamite?luxe Pures GiftDynamika grup w organizacji Wyk éadyĆwiczenie 10 Własności dynamiczne 2015miara dynamicznej twardoscwięcej podobnych podstron