07collapse.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>Blasting off with Bootstrap</title>
  5. <meta charset="utf-8"/>
  6. <meta http-equiv="X-UA-COMPATIBLE" content="IE=Edge"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <link rel="stylesheet" href="../css/bootstrap.min.css"/>
  9. <!--[if lt IE 9]>
  10. <script src="../js/html5shiv.3-7-0.js"></script>
  11. <script src="../js/respond.1-4-2.min.js"></script>
  12. <![endif]-->
  13. </head>
  14. <body>
  15. <div class="container">
  16. <div class="panel-group" id="accordion">
  17. <!-- Panel 1 -->
  18. <div class="panel panel-default panel-info">
  19. <div class="panel-heading">
  20. <h4 class="panel-title">
  21. <a data-toggle="collapse"
  22. data-parent="#accordion"
  23. href="#collapseOne">
  24. Collapsible Group Item #1
  25. </a>
  26. </h4>
  27. </div>
  28. <div id="collapseOne" class="panel-collapse collapse in">
  29. <div class="panel-body">
  30. <p>First Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
  31. do eiusmod
  32. tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
  33. veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
  34. ea
  35. commodo consequat. Duis aute irure dolor in reprehenderit in
  36. voluptate
  37. velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
  38. occaecat
  39. cupidatat non proident, sunt in culpa qui officia deserunt mollit
  40. anim id
  41. est laborum</p>
  42. </div>
  43. </div>
  44. </div>
  45. <!-- Panel 2 -->
  46. <div class="panel panel-default panel-warning">
  47. <div class="panel-heading">
  48. <h4 class="panel-title">
  49. <a data-toggle="collapse"
  50. data-parent="#accordion"
  51. href="#collapseTwo">
  52. Collapsible Group Item #2
  53. </a>
  54. </h4>
  55. </div>
  56. <div id="collapseTwo" class="panel-collapse collapse">
  57. <div class="panel-body">
  58. <p>Second Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
  59. do eiusmod
  60. tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
  61. veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
  62. ea
  63. commodo consequat. Duis aute irure dolor in reprehenderit in
  64. voluptate
  65. velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
  66. occaecat
  67. cupidatat non proident, sunt in culpa qui officia deserunt mollit
  68. anim id
  69. est laborum</p>
  70. </div>
  71. </div>
  72. </div>
  73. <!-- Panel 3 -->
  74. <div class="panel panel-default panel-primary">
  75. <div class="panel-heading">
  76. <h4 class="panel-title">
  77. <a data-toggle="collapse"
  78. data-parent="#accordion"
  79. href="#collapseThree">
  80. Collapsible Group Item #3
  81. </a>
  82. </h4>
  83. </div>
  84. <div id="collapseThree" class="panel-collapse collapse">
  85. <div class="panel-body">
  86. <p>Second Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
  87. do eiusmod
  88. tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
  89. veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
  90. ea
  91. commodo consequat. Duis aute irure dolor in reprehenderit in
  92. voluptate
  93. velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
  94. occaecat
  95. cupidatat non proident, sunt in culpa qui officia deserunt mollit
  96. anim id
  97. est laborum</p>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. <!-- https://ajax.googleapis.com/ajax/libs/jquery/1.11.1.jquery.min.js -->
  104. <script src="../js/jquery-1.11.2.min.js"></script>
  105. <script src="../js/bootstrap.js"></script>
  106. <script type="text/javascript">
  107. // $('.collapse').collapse({
  108. // "toggle": false
  109. // });
  110. $('.collapse').on('show.bs.collapse', function () {
  111. console.log("Opening tab", this.id)
  112. });
  113. $('.collapse').on('shown.bs.collapse', function () {
  114. console.log("Tab opened", this.id)
  115. });
  116. $('.collapse').on('hide.bs.collapse', function () {
  117. console.log("Closing tab", this.id)
  118. });
  119. $('.collapse').on('hidden.bs.collapse', function () {
  120. console.log("Tab closed", this.id)
  121. });
  122. </script>
  123. </body>
  124. </html>