Witam. Znalazłem niezły zegarek w sieci i chciałem się dowiedzieć, jak go zmodyfikować, żeby usunąć z niego pole tekstowe?
Link: http://webmaster.helion.pl/kurshtml/skrypt/zegarek.htm
Dzięki za pomoc.
<script language="javascript"> <!--W3e JAVAscript Preset var timerID = null; var timerRunning = false; function stopclock() { if(timerRunning) clearTimeout(timerID) timerRunning = false; } function startclock() { stopclock(); showtime(); } function showtime() { var now = new Date(); var hours = now.getHours(); var minutes = now.getMinutes(); var seconds = now.getSeconds(); var timeValue = "" + ((hours > 12) ? hours - 12 : hours); timeValue += ((minutes < 10) ? ":0" : ":") + minutes; timeValue += ((seconds < 10) ? ":0" : ":") + seconds; timeValue += (hours >= 12) ? " P.M." : " A.M."; document.getElementById( 'oClock' ) = timeValue; timerID = setTimeout("showtime()",1000); timerRunning = true; } //--> </script>
<script language="javascript"> <!--W3e JAVAscript Preset var timerID = null; var timerRunning = false; function stopclock() { if(timerRunning) clearTimeout(timerID) timerRunning = false; } function startclock() { stopclock(); showtime(); } function showtime() { var now = new Date(); var hours = now.getHours(); var minutes = now.getMinutes(); var seconds = now.getSeconds(); var timeValue = "" + ((hours > 12) ? hours - 12 : hours); timeValue += ((minutes < 10) ? ":0" : ":") + minutes; timeValue += ((seconds < 10) ? ":0" : ":") + seconds; timeValue += (hours >= 12) ? " P.M." : " A.M."; document.getElementById( 'oClock' ).innerHTML = timeValue; timerID = setTimeout("showtime()",1000); timerRunning = true; } //--> </script> <body onload="startclock();">
<script language="javascript"> <!--W3e JAVAscript Preset var timerID = null; var timerRunning = false; function stopclock() { if(timerRunning) clearTimeout(timerID) timerRunning = false; } function startclock() { stopclock(); showtime(); } function showtime() { var now = new Date(); var hours = now.getHours(); var minutes = now.getMinutes(); var seconds = now.getSeconds(); var timeValue = hours; timeValue += ((minutes < 10) ? ":0" : ":") + minutes; timeValue += ((seconds < 10) ? ":0" : ":") + seconds; document.getElementById( 'oClock' ).innerHTML = timeValue; timerID = setTimeout("showtime()",1000); timerRunning = true; } //--> </script> <body onload="startclock();">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script type="text/javascript"> function showtime() { var now = new Date(); var hours = now.getHours(); var minutes = now.getMinutes(); var seconds = now.getSeconds(); var timeValue; timeValue = hours; timeValue += ((minutes < 10) ? ":0" : ":") + minutes; timeValue += ((seconds < 10) ? ":0" : ":") + seconds; document.getElementById( 'oClock' ).innerHTML = 'Godzina ' + timeValue; setTimeout("showtime()", 1000); } </script> </head> <body onload="showtime();"> </body> </html>
<script type="text/javascript"> function czas() { var d = new Date(); sekund = (d.getSeconds()); minut = (d.getMinutes()); godzin = (d.getHours()); if (minut<=9) minut= "0" + minut; if (sekund <= 9 ) sekund ="0" + sekund; if (godzin <= 9 ) godzin ="0" + godzin; document.getElementById('div1').innerHTML = "Czas: " + godzin + ":" + minut + ":" + sekund; } window.setInterval(czas,1000); </script>