停止查看Script
發(fā)布時間:2008-12-19 閱讀數(shù): 次 來源:網(wǎng)樂原科技
--------------------------------------------------------------------------------
<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>
--------------------------------------------------------------------------------