Get Free Script Stopwatch with Memory Saved

Mau pasang stopwatch di website ? coba ini.
Bukan hanya menghitung kecepatan saja, script ini juga dapat menyimpan hingga tiga kali penyimpanan dan kemudian direset untuk menghitung ulang.
<script language="JavaScript" type="text/javascript">
<!-- Copyright 2001, Sandeep Gangadharan -->
<!-- Free script by http://askedboss.com -->
<!-- For more free scripts go to http://www.sivamdesign.com/scripts/ -->
<!--
var sec = 0;
var min = 0;
var hour = 0;
var theResult = "";
function stopwatch(text) {
   sec++;
  if (sec == 60) {
   sec = 0;
   min = min + 1; }
  else {
   min = min; }
  if (min == 60) {
   min = 0;
   hour += 1; }
if (sec<=9) { sec = "0" + sec; }
   document.clock.stwa.value = ((hour<=9) ? "0"+hour : hour) + " : " + ((min<=9) ? "0" + min : min) + " : " + sec;
  if (text == "Start") { document.clock.theButton.value = "Stop "; }
  if (text == "Stop ") { document.clock.theButton.value = "Start"; sec = sec-1; sec--; }
  if (document.clock.theButton.value == "Start") {
   return true; }
SD=window.setTimeout("stopwatch();", 1000);
 theResult = document.clock.stwa.value;
}
function resetIt() {
  sec = 0;
  min = 0;
  hour = 0;
  if (document.clock.theButton.value == "Stop ") {
  document.clock.theButton.value = "Start"; }
  window.clearTimeout(SD);
 }
function saveIt() {
 if (document.clock.saver.value == "Save Time 1") {
   document.clock.saver.value = "Save Time 2";
 document.getElementById('time01').innerHTML = "<b>Time 1 =</b> " + theResult + "<br />";
 return;
 }
 if (document.clock.saver.value == "Save Time 2") {
   document.clock.saver.value = "Save Time 3";
 document.getElementById('time02').innerHTML = "<b>Time 2 =</b> " + theResult + "<br />";
 return;
 }
 if (document.clock.saver.value == "Save Time 3") {
   document.clock.saver.value = "Reset Times!";
 document.getElementById('time03').innerHTML = "<b>Time 3 =</b> " + theResult;
 return;
 }
 if (document.clock.saver.value == "Reset Times!") {
  document.getElementById('time01').innerHTML = "";
  document.getElementById('time02').innerHTML = "";
  document.getElementById('time03').innerHTML = "";
  document.clock.saver.value = "Save Time 1";
 }
}
// -->
</script>
<!-- This goes into the BODY of the file -->
<table bgcolor="#c0c0c0" align="center" border="0" width="140" cellspacing="0">
  <tr>
     <td align="center">
       <font face="verdana, arial, helvetica, sans-serif" size="2">
       <b>STOPWATCH</b></font>
     </td>
  </tr>
  <tr>
     <td align="center">
      <form name="clock">
       <input type="text" size="12" name="stwa" value="00 : 00 : 00" style="text-align:center" /><br />
       <input type="button" name="theButton" onClick="stopwatch(this.value);" value="Start" />
       <input type="button" value="Reset" onClick="resetIt();reset();" /><br />
       <input type="button" name="saver" value="Save Time 1" onClick="saveIt();" />
     </td>
  </tr>
  <tr>
     <td align="center">
      <span id="time01" style="text-align:center; font-family:arial; font-size:10pt"></span>
      <span id="time02" style="text-align:center; font-family:arial; font-size:10pt"></span>
      <span id="time03" style="text-align:center; font-family:arial; font-size:10pt"></span>
      </form>
     </td>
  </tr>
</table>
Silahkan modifikasi sesuai keinginan pada kode yang saya beri tanda tersebut..

Anda juga bisa menambahkan hingga lebih dari 3 kali penyimpanan, yaitu dengan menambah time04

Hasilnya:

STOPWATCH


URL

Komentar yang bermanfaat mendapat Rating*****oleh Admin blog ini