DIGITALNE HODINKY (2)

ID
Nazov / Name:
Popis / Description:
Dlzka / Length:
Testovane pod / Tested under:

 

080
p080.html / p080.zip
Iduce digitalne hodinky so stopkou
2331b
NN 4.04, IE 4.0

UKAZKA / CLICK HERE

Zdrojovy tvar / Source code:

<html> <head> <title> JavaScript DESTINATION - P080 </title> <script language="JavaScript"> <!-- img = new Array() for(var i=0; i <= 14; i++) { img[i] = new Image() } img[1].src = "images/dg0.gif" img[2].src = "images/dg1.gif" img[3].src = "images/dg2.gif" img[4].src = "images/dg3.gif" img[5].src = "images/dg4.gif" img[6].src = "images/dg5.gif" img[7].src = "images/dg6.gif" img[8].src = "images/dg7.gif" img[9].src = "images/dg8.gif" img[10].src = "images/dg9.gif" img[11].src = "images/dgon.gif" img[12].src = "images/dgoff.gif" img[13].src = "images/dgam.gif" img[14].src = "images/dgpm.gif" var base = "images/dg" var space = "images/space.gif" var per = false function stop() { document.one.src = space document.two.src = space document.three.src = space document.four.src = space document.five.src = space document.six.src = space per = false } function pause() { per = false } function go() { per = true start() } function start() { if(per == true) { var now = new Date() var hours = now.getHours(); var ampm = (hours < 12) ? "am" : "pm" hours = (hours > 12) ? (hours - 12) + "" : hours + "" hours = (hours == "0") ? "12" : hours hours = (hours < 10) ? "0" + hours : hours + "" var minutes = now.getMinutes(); minutes = (minutes < 10) ? "0" + minutes : minutes + "" var seconds = now.getSeconds(); seconds = (seconds < 10) ? "0" + seconds : seconds + "" document.one.src = (hours.charAt(0)=="0") ? space : add(hours.charAt(0)) document.two.src = add(hours.charAt(1)) document.three.src = (now.getSeconds() % 2) ? add("on") : add("off") document.four.src = add(minutes.charAt(0)) document.five.src = add(minutes.charAt(1)) document.six.src = add(ampm) setTimeout("start()",1000) } } function add(it) { return "images/dg" + it + ".gif" } // --> </script> </head> <body onLoad="go()"> <img src="images/space.gif" width=16 height=21 alt="clock" name="one"><img src="images/space.gif" width=16 height=21 alt="clock" name="two"><img src="images/space.gif" width=14 height=21 alt="clock" name="three"><img src="images/space.gif" width=16 height=21 alt="clock" name="four"><img src="images/space.gif" width=16 height=21 alt="clock" name="five"><img src="images/space.gif" width=16 height=21 alt="clock" name="six"> <br> <a href="javascript:go()">Start!</a> | <a href="javascript:pause()">Pauza!</a> | <a href="javascript:stop()">Koniec!</a> </body> </html>
[ Navrat / BACK ]