search

Home  >  Q&A  >  body text

PHP multitasking countdown help

I am a novice. I have been working on a post list countdown function recently. I suffer from my lack of talent and lack of skills, so the countdown has not been able to work well. I forgot to give you some advice!

Get back to the topic

I want to get the time when the post was published to start the countdown, countdown End Close Show Post!

Because it is multi-tasking, only one of the referenced countdown codes can take effect, or the countdown can be refreshed and the countdown starts again, which is very distressing! I hope you guys can give me some advice!

终
南
山
下
求
真
经终 南 山 下 求 真 经1380 days ago1161

reply all(2)I'll reply

  • 查无此人

    查无此人2021-04-15 13:36:46

    Will the countdown be done? This is the countdown of js.

    Use php to calculate the remaining seconds. The current time - the publishing timestamp is the remaining seconds. . Then give the remaining seconds to the regcountdown variable

    var regcountdown=30;regSendCode= $("#regSendCode");			settime(regSendCode);		function settime(regSendCode) {			//发送验证码倒计时			if(regcountdown == 0){				regSendCode.removeClass('disabled');				regSendCode.attr('onclick','sendemail()');				regSendCode.html("获取验证码");				regcountdown = 30;				return;			}else{				regSendCode.addClass('disabled');				regSendCode.removeAttr('onclick');				regSendCode.html("重新发送("+regcountdown+")");				regcountdown--;			}			setTimeout(function(){				settime(regSendCode);			},1000);		}

    reply
    0
  • 查无此人

    I used this countdown when registering, because I don’t know your code and can’t tell you directly. . You saw it yourself, change this js code.

    查无此人 · 2021-04-15 13:37:39
  • Cancelreply