aboutsummaryrefslogtreecommitdiff
path: root/js/tests/visual/button.html
blob: 01c7dd4b3411b4cd78de27728b3946a82ae55f4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html>
<head>
  <title>Button</title>
  <link rel="stylesheet" type="text/css" href="../../../dist/css/bootstrap.min.css">
</head>
<body>

<div class="container">

  <div class="page-header">
    <h1>Button <small>Bootstrap Visual Test</small></h1>
  </div>

  <button type="button" data-loading-text="Loading for 3 seconds..." class="btn btn-primary js-loading-button">
    Loading state
  </button>

  <button type="button" class="btn btn-primary" data-toggle="button">Single toggle</button>

  <div class="btn-group" data-toggle="buttons">
    <label class="btn btn-primary">
      <input type="checkbox"> checkbox 1
    </label>
    <label class="btn btn-primary">
      <input type="checkbox"> checkbox 2
    </label>
    <label class="btn btn-primary">
      <input type="checkbox"> checkbox 3
    </label>
  </div>

  <div class="btn-group" data-toggle="buttons">
    <label class="btn btn-primary">
      <input type="radio" name="options" id="option1"> Radio 1
    </label>
    <label class="btn btn-primary">
      <input type="radio" name="options" id="option2"> Radio 2
    </label>
    <label class="btn btn-primary">
      <input type="radio" name="options" id="option3"> Radio 3
    </label>
  </div>

</div>

<!-- JavaScript Includes -->
<script src="../vendor/jquery.min.js"></script>
<script src="../../transition.js"></script>
<script src="../../button.js"></script>

<!-- JavaScript Test -->
<script>
$(function () {
  $('.js-loading-button').on('click', function () {
    var btn = $(this).button('loading')
    setTimeout(function (){
      btn.button('reset')
    }, 3000)
  })
})
</script>
</body>
</html>