09popover.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. <style type="text/css">
  14. :focus {
  15. border-radius: 25%;
  16. }
  17. </style>
  18. </head>
  19. <body>
  20. <div class="container">
  21. <input type="button" value="Premier" />
  22. <button type="button" class="btn btn-default popoverButton"
  23. title="This is a demo popover"
  24. data-toggle="popover" data-placement="bottom" data-content="Lorem ipsum dolor">
  25. Click me!
  26. </button>
  27. </div>
  28. <!-- https://ajax.googleapis.com/ajax/libs/jquery/1.11.1.jquery.min.js -->
  29. <script src="../js/jquery-1.11.2.min.js"></script>
  30. <script src="../js/bootstrap.js"></script>
  31. <script type="text/javascript">
  32. var options = {
  33. animation: true,
  34. placement: "right",
  35. // Inclure "focus" pour l'accessibilité.
  36. trigger: "hover focus click" // "hover focus", "hover click" ...
  37. };
  38. // or options = "show"|"hide"|"toggle"|"destroy"
  39. $(document).ready(function () {
  40. $('.popoverButton').popover(options);
  41. });
  42. $('.popoverButton').on('show.bs.popover', function () {
  43. console.log('Showing popover');
  44. });
  45. $('.popoverButton').on('shown.bs.popover', function () {
  46. console.log('Popover shown');
  47. });
  48. $('.popoverButton').on('hide.bs.popover', function () {
  49. console.log('Hiding popover');
  50. });
  51. $('.popoverButton').on('hidden.bs.popover', function () {
  52. console.log('Popover hidden');
  53. });
  54. </script>
  55. </body>
  56. </html>