Administrator
Administrator
Dołączył: 15 Lis 2008
Posty: 89
Przeczytał: 0 tematów
Ostrzeżeń: 0/5 Skąd: Polska
|
Wysłany: Pon 17:25, 17 Lis 2008 Temat postu: Stoper |
|
|
Kod: | <SCRIPT LANGUAGE="JavaScript">
/*
For this script
Visit http://java-scripts.net
or http://wsabstract.com
*/
var ms = 0;
var state = 0;
function startstop() {
if (state == 0) {
state = 1;
then = new Date();
then.setTime(then.getTime() - ms);
} else {
state = 0;
now = new Date();
ms = now.getTime() - then.getTime();
document.stpw.time.value = ms;
}
}
function swreset() {
state = 0;
ms = 0;
document.stpw.time.value = ms;
}
function display() {
setTimeout("display();", 50);
if (state == 1) {now = new Date();
ms = now.getTime() - then.getTime();
document.stpw.time.value = ms;
}
}
window.onload=display
</SCRIPT>
<CENTER>
<FORM NAME="stpw">
Time:
<INPUT TYPE="text" Name="time">
<INPUT TYPE="BUTTON" Name="ssbutton" VALUE="Start/Stop" onClick="startstop()">
<INPUT TYPE="BUTTON" NAME="reset" VALUE="Reset" onClick="swreset()">
</FORM>
</CENTER> |
Post został pochwalony 0 razy
|
|