标签:https lse ar9 logs 遮罩 gettime function com func
<script> var isClick = true; $("button").on("click",function(){ if(isClick) { isClick = false; //事件 console.log(‘我被点击了‘); //定时器 setTimeout(function() { isClick = true; }, 1000);//一秒内不能重复点击 }else{ console.log(‘请勿过快点击‘); } }); </script>
https://www.cnblogs.com/clear93/p/8086374.html
var lastClick; lockClick(){ var nowClick = new Date(); if (lastClick === undefined) { lastClick = nowClick; return true; } else { if (Math.round((nowClick.getTime() - lastClick.getTime())) > 500) { lastClick = nowClick; return true; } else { lastClick = nowClick; return false } } } this.on(‘click‘,()=>{ if (this.lockClick()) { //你的函数代码 } })
标签:https lse ar9 logs 遮罩 gettime function com func
原文地址:https://www.cnblogs.com/houxianzhou/p/14462157.html