Horje Website
Bootstrap 3 Ref Js Tooltip Events Stacked – Bootstrap Ref Js Tooltip – Bootstrap JS Tooltip Reference – Bootstrap Code

Bootstrap 3 Ref Js Tooltip Events Stacked – Bootstrap Ref Js Tooltip

Bootstrap 3 Ref Js Tooltip Events Stacked - Bootstrap Ref Js Tooltip - Bootstrap JS Tooltip Reference - Bootstrap Code


 
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>Bootstrap Example</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
  8. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  9. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
  10. </head>
  11. <body>
  12. <div class="container">
  13. <h3>Tooltip Events</h3>
  14. <a href="#" data-toggle="tooltip" title="Hooray!">Tooltip Example</a>
  15. <div>
  16. <p>The <strong>show.bs.tooltip</strong> event occurs when the tooltip is about to be shown.</p>
  17. <p>The <strong>shown.bs.tooltip</strong> event occurs when the tooltip is fully shown.</p>
  18. <p>The <strong>hide.bs.tooltip</strong> event occurs when the tooltip is about to be hidden.</p>
  19. <p>The <strong>hidden.bs.tooltip</strong> event occurs when the tooltip is fully hidden.</p>
  20. <button type="button" class="btn btn-primary">Show</button>
  21. <button type="button" class="btn btn-warning">Hide</button>
  22. <button type="button" class="btn btn-success">Toggle</button>
  23. <button type="button" class="btn btn-danger">Destroy</button>
  24. </div>
  25. </div>
  26. <script>
  27. $(document).ready(function(){
  28. $(".btn-primary").click(function(){
  29. $("[data-toggle='tooltip']").tooltip('show');
  30. });
  31. $(".btn-warning").click(function(){
  32. $("[data-toggle='tooltip']").tooltip('hide');
  33. });
  34. $(".btn-success").click(function(){
  35. $("[data-toggle='tooltip']").tooltip('toggle');
  36. });
  37. $(".btn-danger").click(function(){
  38. $("[data-toggle='tooltip']").tooltip('destroy');
  39. });
  40. $("[data-toggle='tooltip']").on('show.bs.tooltip', function(){
  41. alert('The tooltip is about to be shown.');
  42. });
  43. $("[data-toggle='tooltip']").on('shown.bs.tooltip', function(){
  44. alert('The tooltip is now fully shown.');
  45. });
  46. $("[data-toggle='tooltip']").on('hide.bs.tooltip', function(){
  47. alert('The tooltip is about to be hidden.');
  48. });
  49. $("[data-toggle='tooltip']").on('hidden.bs.tooltip', function(){
  50. alert('The tooltip is now hidden.');
  51. });
  52. });
  53. </script>
  54. </body>
  55. </html>



Try Your Self ->



Published:
October 6, 2020
Author:
admin
Category:
Bootstrap 3 JavaScript Reference, Bootstrap Source Code
Views:
14

This article was posted in Bootstrap 3 JavaScript Reference, Bootstrap Source Code and tagged , , . Bookmark the permalink. Follow comments with the RSS feed for this post.Post a Comment or leave a trackback: Trackback URL.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Horje © 2011 - 2022