html로, 버튼을 만듭니다. 버튼이 초당 한 번 클릭해야합니다. 내가 할 수있는 더 빨리 또는 더 나은 솔루션이,자바 스크립트, 빨리 버튼을 클릭하십시오 ~
inputTooFast = function()
{
var curDate = new Date();
if(curDate.getHours() == this.lastinputtime[0])
if(curDate.getMinutes() == this.lastinputtime[1])
if(curDate.getSeconds() == this.lastinputtime[2])
if((curDate.getMilliseconds() - this.lastinputtime[2]) < 999)
{
this.lastinputtime[0] = curDate.getHours();
this.lastinputtime[1] = curDate.getMinutes();
this.lastinputtime[2] = curDate.getSeconds();
this.lastinputtime[3] = curDate.getMilliseconds();
return true;
}
this.lastinputtime[0] = curDate.getHours();
this.lastinputtime[1] = curDate.getMinutes();
this.lastinputtime[2] = curDate.getSeconds();
this.lastinputtime[3] = curDate.getMilliseconds();
return false;
}
및 샘플 사용이 여기에 너무
function sendMessage()
{
if(theObj.inputTooFast()==true)
return;
...
some valid code here
...
}
그래서 내 코드는 여기에 ~
을 빠른 버튼 클릭을 허용하지 않으려는 이? jquery를 사용하고 있습니다.
일반적으로 채팅 보내기 버튼은이 기능을 사용할 것입니다 ~ –
~, 나는 단지 대답을 수락하는 방법을 몰랐습니다. 귀하의 질문에, 나는 그것을 발견 ~ 감사 ~ –