djmartins Posted April 5, 2006 Report Share Posted April 5, 2006 Atradu skriptu kur pulkstenis skaita uz prieksu bet vins skaita milisekundes un sekundes.Tacu man vajag lai butu minutes un stundas un viss.Kaa taa var uztaisit?Kur kas butu japamaina? <script> <!-- var milisec = 0; var seconds = 0; function display(){ if (milisec>=9){ milisec=0 seconds+=1 } else milisec+=1 document.d.d2.value = seconds + "." + milisec; setTimeout("display()",100); } --> </script> <body onload="display();"> <form name="d"> <input type="text" size="8" name="d2"> </form> Link to comment Share on other sites More sharing options...
bubu Posted April 5, 2006 Report Share Posted April 5, 2006 minūte=60 sekundes stunda=60 minūtes Pie tam, neizskatās, ka tās ir milisekundes, bet gan simts milisekunžu intervāli. Link to comment Share on other sites More sharing options...
Stopp Posted April 5, 2006 Report Share Posted April 5, 2006 http://stopp.eclub.lv/products/webpulkstenis.zip oj ku vecs, bet, ja pareizi atceros, tas ir tas, ko gribi. aptuveni :) Link to comment Share on other sites More sharing options...
djmartins Posted April 6, 2006 Author Report Share Posted April 6, 2006 Nu sita izdariju bet tagad vispar nestrada kas pa vainu? <!-- var minute = 0; var hours = 0; function display(){ if (minute>=9){ minute=0 hours+=1 } else minute+=1 document.d.d2.value = hours + "." + minute; setTimeout("display()",100); } --> </script> <body onload="display();"> <form name="d"> <input type="text" size="8" name="d2"> </form> Link to comment Share on other sites More sharing options...
GedroX Posted April 6, 2006 Report Share Posted April 6, 2006 function display(){ minute += 1; if (minute >= 60){ minute=0 hours+=1 } document.d.d2.value = hours + ":" + (minute < 10 ? '0' : '') + minute; setTimeout("display()", 1000); } Link to comment Share on other sites More sharing options...
djmartins Posted April 6, 2006 Author Report Share Posted April 6, 2006 function display(){ minute += 1; if (minute >= 60){ minute=0 hours+=1 } document.d.d2.value = hours + ":" + (minute < 10 ? '0' : '') + minute; setTimeout("display()", 1000); } Tapat nestrada radas tuksa form un viss! Link to comment Share on other sites More sharing options...
GedroX Posted April 6, 2006 Report Share Posted April 6, 2006 Pilnais variants, kas man iet: <html> <head> <script> <!-- var minute = 0; var hours = 0; function display(){ minute += 1; if (minute >= 60){ minute = 0 hours += 1 } document.d.d2.value = hours + ":" + (minute < 10 ? '0' : '') + minute; setTimeout("display()", 1000); } //--> </script> <body onload="display();"> <form name="d"> <input type="text" size="8" name="d2"> </form> </body> </html> Pārliecinies, ka vēlāk netiek mainīts window.onload vai document.body.onload (neesmu pārliecināts). Link to comment Share on other sites More sharing options...
djmartins Posted April 6, 2006 Author Report Share Posted April 6, 2006 GedroX paldies strada! Link to comment Share on other sites More sharing options...
Recommended Posts