06tabs.html 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. <!-- Nav tabs -->
  17. <ul class="nav nav-tabs">
  18. <li class="active"><a href="#home" data-toggle="tab">Home</a></li>
  19. <li><a href="#profile" data-toggle="tab">Profile</a></li>
  20. <li><a href="#messages" data-toggle="tab">Messages</a></li>
  21. <li><a href="#settings" data-toggle="tab">Settings</a></li>
  22. </ul>
  23. <!-- Tab panes -->
  24. <div class="tab-content">
  25. <div class="tab-pane fade in active" id="home">
  26. <h3>The Home</h3>
  27. </div>
  28. <div class="tab-pane fade" id="profile">
  29. <h3>The profile</h3>
  30. </div>
  31. <div class="tab-pane fade" id="messages">
  32. <h3>Messages central</h3>
  33. </div>
  34. <div class="tab-pane fade" id="settings">
  35. <h3>Settings panel</h3>
  36. </div>
  37. </div>
  38. </div>
  39. <!-- https://ajax.googleapis.com/ajax/libs/jquery/1.11.1.jquery.min.js -->
  40. <script src="../js/jquery-1.11.2.min.js"></script>
  41. <script src="../js/bootstrap.js"></script>
  42. <script type="text/javascript">
  43. $('.nav-tabs li a').on('show.bs.tab', function () {
  44. console.log('Opening tab');
  45. });
  46. $('.nav-tabs li a').on('shown.bs.tab', function () {
  47. console.log('Tab opened');
  48. });
  49. </script>
  50. </body>
  51. </html>