js 单击与双击事件

<script type="text/javascript">
function c(obj,type){
 obj.clicktype = type;
 if(window.timer){
  window.clearTimeout(timer);
 }
 timer = window.setTimeout(doit,400);
}

function doit(){
 alert(document.getElementById("test").clicktype);
}

</script>
</head>

<body>
</body>
 

你可能感兴趣的:(c,timer,function)