Inserire mini-orologio., Ore, minuti e secondi

« Older   Newer »
  Share  
Nagato Aka Pain
view post Posted on 19/8/2010, 00:46     +1   -1




Avere un mini orologio nel forum non č pių un problema:

CODICE
<script type="text/javascript"><!--
var timerID = null;
var timerRunning = false;
function StartClock (){

if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
showTime();
}
function showTime (){
var adesso = new Date();
var ore = adesso.getHours();
var minuti = adesso.getMinutes();
var secondi = adesso.getSeconds();
var timeVal = "" + ore;
timeVal += ((minuti < 10) ? ":0" : ":") + minuti;
timeVal += ((secondi < 10) ? ":0" : ":") + secondi;
document.orologio.tempo.value = timeVal;
timerID = setTimeout("showTime()",1000);
timerRunning = true;
}
//--></script>
<body onload="StartClock()">
<form name="orologio" onsubmit="0">Sono le ore <input type="text" name="tempo" size="8"></form>


Da inserire in Amministrazione > Gestione codici HTML > Codice HTML che verrā visualizzato in cima al sito.
 
Top
0 replies since 19/8/2010, 00:46   57 views
  Share