<script>
var temp = 0;
var doNumber = 0;
var clearTimeOut = null;
var SetTimeOut = null;
function abc_onClick()
{
temp = temp + 1;
tempValueChanage();
}
function tempValueChanage()
{
doNumber = doNumber + 1;
SetTimeOut = setTimeout(tempValueChanage,300);
if( doNumber >= 2 && temp == 1)
{
temp = 0;
doNumber = 0;
clearTimeout(SetTimeOut);
alert("单击事件!");
}
if( temp == 0 )
{
clearTimeout(SetTimeOut);
doNumber = 0;
}
}
function abc_onDblClick()
{
temp = 0;
doNumber = 0;
alert("双击事件!");
}
</script>
<input id="spanData" type="button" value="onClick or onDblClick" onDblClick="abc_onDblClick()" onClick="abc_onClick()">
posted on 2006-04-03 15:47
汪杰 阅读(293)
评论(0) 编辑 收藏 引用 所属分类:
hengxing网站js