javascript 简易计时器
<script language="javascript">
var timeLen = "0";
var timer = null;
function beginTimer()
{
var hour="0";
var minute="0";
var second="0";
timeLen = parseInt(timeLen)+1;
hour = parseInt(timeLen/3600) ;
minute = parseInt((timeLen-(hour*3600))/60);
second = parseInt((timeLen-(minute*60))%60);
//document.frmtimer.time.innerText = hour+"时"+minute+"分"+second+"秒";
document.getElementById("time").innerText=hour+"时"+minute+"分"+second+"秒";
timer = setTimeout("beginTimer()",1000);
document.getElementById("startButton").disabled = true;
document.getElementById("stopButton").disabled = false;
}
function stopTimer()
{
clearTimeout(timer);
document.getElementById("startButton").disabled = false;
document.getElementById("stopButton").disabled = true;
}
</script>
<html>
<head>
<title>简易计时器</title>
</head>
<body>
<form name="frmtimer" action="" method="post">
<hr>
<input type="text" name="time" id="time">
<br>
<input type="button" value="开始计时" name="start" id="startButton" onClick="beginTimer();">
<input type="button" value="停止" name="stop" id="stopButton" onClick="stopTimer();">
<hr>
</form>
</body>
</html>
相关文档:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Admin ManageMenu</title>
&n ......
MochaUI
MochaUI is a web applications user interface library built on the Mootools JavaScript framework.
网址:http://mochaui.com/
演示:http://mochaui.com/demo/
授权方式:MIT License
jquery UI
网址:http://ui.jquery.com/
演示:http://ui.jquery.com/demos
授权方式:MIT and GPL lic ......
1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)><td>no</table> 可用于Table
2. <body onselectstart="return false"> 取消选取、防止复制
3. onpaste="return false" 不准粘贴
4. oncopy="return false;" oncut="retu ......
大一点的框架都有这个东西。Prototype原来的继承机制非常弱,为了与mootools对抗也强化了这一方面。嘛,要用原型继承来模仿类继承,都基本存在一个克隆函数。把父类的原型属性复制到子类上去。理念的东西暂时这么多,动手实践一下最实际。我们设计一个数组类,拥有原生数组的能力与新扩展的能力。
var isNumber ......
1、〖打开〗命令的实现
[格式]:document.execCommand("open")
[说明]这跟VB等编程设计中的webbrowser控件中的命令有些相似,大家也可依此琢磨琢磨。
[举例]在<body></body>之间加入:
<a href="###" onclick=document.execCommand("open")>打开</a>
2、〖使用 记事本 编辑〗命令的实现
......