小编Aus*_*can的帖子

向Java倒计时添加按钮

我是Java的新手,对此不太了解。但是,我设法创建了一个倒计时计时器,该计时器可以像我希望的那样正常工作。这很简单,但是基本上它是一个倒计时到特定日期的计时器,一旦到达指定的日期和时间,它就会显示我可以自定义的文本。我希望这段代码能够在倒数到零时显示带有超链接的按钮。这是我到目前为止的代码:

// Set the date we're counting down to
var countDownDate = new Date(Date.now() + 20000).getTime();

// Update the count down every 1 second
var x = setInterval(function() {

  // Get todays date and time
  var now = new Date().getTime();

  // Find the distance between now and the count down date
  var distance = countDownDate - now;

  // Time calculations for days, hours, minutes and seconds
  var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  var hours …
Run Code Online (Sandbox Code Playgroud)

html javascript countdown

1
推荐指数
1
解决办法
225
查看次数

标签 统计

countdown ×1

html ×1

javascript ×1