JQuery按钮锁定了一段时间

时间:2015-04-10 18:36:27

标签: javascript ajax timer

我在HTML网页上有一些按钮。

点击一个后,我需要将其余部分禁用1分钟。我怎么能这样做?

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

1 个答案:

答案 0 :(得分:0)

//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 );

 });

});

类切换的任何输入都会受到影响<button class="toggle"></button>

PS。此代码未经过测试。

相关问题