Home > front end >  Modal button countdown
Modal button countdown

Time:04-13

I like to write in modal countdown display not to come out, how to modify, please?
Click on send verification code button click event
 $(" # btn_checkCode "). Click (function () {
$(" # btn_checkCode "). Attr (" disabled ", "disabled");//click once again points
Var interval=setInterval (function () {//define timer
$(" # btn_checkCode "). Val (c + retry after "s");
C -;
If (c==0) {
ClearInterval (interval);//remove the timer
$(" # btn_checkCode "). Val (" to get verification code ");
$(" # btn_checkCode "). RemoveAttr (" disabled ");//remove this attribute
C=60;
Code="";//generate a new code, before the use of the
GenerateCheckCode ()
}
}, 1000);
})

Modal code
 & lt; Div tabindex="1" role="dialog" aria - labelledby="myLargeModalLabel & gt;" 










CodePudding user response:

Variable c is the countdown to the number of seconds, the default is 60, defined in the previous code
  • Related