雅安论坛

标题: jq实现倒计时以及完成以后进行操作使用 [打印本页]

作者: 未命名    时间: 2021-12-27 09:00
标题: jq实现倒计时以及完成以后进行操作使用
  1. function count(wait) {
  2.             function time() {
  3.                 if (wait == 0) {
  4.                    //倒计时完成以后进行操作
  5.                 } else {
  6.                     $("#varifyCode").show().text(wait + "s");//显示倒计时数字
  7.                     wait--;
  8.                     setTimeout(function () {
  9.                         time();
  10.                     }, 1000)
  11.                 }
  12.             }
  13.             time();
  14.         }
  15.    
  16. count(60);<span style="color: rgb(0, 0, 0); font-family: &quot;PingFang SC&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;Microsoft Yahei&quot;, sans-serif; font-size: 27.6px; background-color: rgb(255, 255, 255);"> </span>
复制代码






欢迎光临 雅安论坛 (https://www.yaanbbs.net/) Powered by Discuz! X3.4