Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript JQuery按钮会锁定一段时间_Javascript_Ajax_Timer - Fatal编程技术网

Javascript JQuery按钮会锁定一段时间

Javascript JQuery按钮会锁定一段时间,javascript,ajax,timer,Javascript,Ajax,Timer,我在HTML网页上有一些按钮 单击一个后,我需要禁用其余的1分钟。我如何才能做到这一点 我还需要显示一分钟的计时器。我怎么做 //start jquery.. $(function(){ //get the the click of the button $("#button").click(function(){ //disabled class toggle $(".toggle").prop('disabled', true); //enabled after 1

我在HTML网页上有一些按钮

单击一个后,我需要禁用其余的1分钟。我如何才能做到这一点

我还需要显示一分钟的计时器。我怎么做

//start jquery..
$(function(){

//get the the click of the button

 $("#button").click(function(){
   //disabled class toggle
   $(".toggle").prop('disabled', true);

  //enabled after 1 minute
  setTimeout( function(){ 

    //here you enabled all the html of class toggle.
   $(".toggle").prop('disabled', false);

  }
 , 60000 );

 });

});
类切换的任何输入都将受到影响


此代码未经测试。

Easy,Html有一个禁用的属性,您可以使用jquery或javascript将其添加到所需的元素中。只需构建一个计时器函数,该函数将在开始时添加此属性,并在一分钟后将其删除。我知道算法,但我需要查看其代码。请提供至少一些html和您投入的精力。有很多例子可以用来禁用某些东西。到目前为止你尝试过什么吗?谢谢,你太棒了。