Java教程

计时器

本文主要是介绍计时器,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

https://scotch-io.github.io/javascript-starter-course/12-stopwatch.html

欣赏一下别人的代码

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Getting Started with JavaScript</title>

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <style>
    body,
    .jumbotron {
      padding: 30px;
    }

    .timer {
      font-size: 120px;
    }
  </style>
</head>

<body>

  <div class="jumbotron text-center">

    <!-- timer -->
    <div class="timer">
      <span class="minutes">00</span> : <span class="seconds">00</span>
    </div>

    <!-- timer buttons -->
    <div class="timer-buttons">
      <button class="btn btn-lg btn-success" data-action="start">
        Start
      </button>
      <button class="btn btn-lg btn-danger" data-action="stop">
        Stop
      </button>
      <button class="btn btn-link btn-block" data-action="reset">
        Reset
      </button>
    </div>
  </div>

  <!-- 

	
这篇关于计时器的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!