Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Setting Show/Hide Time Delay for Bootstrap 4 Tooltips</title> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css"> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js"></script> <style> .bs-example{ margin: 100px 50px; } .bs-example a{ margin: 50px; } </style> <script> $(document).ready(function(){ // Showing and hiding tooltip with same speed $(".tooltip-tiny").tooltip({ delay: 500 // show tooltip after 500 milliseconds }); // Showing and hiding tooltip with different speed $(".tooltip-large").tooltip({ delay: {show: 0, hide: 2000} }); }); </script> </head> <body> <div class="bs-example"> <p> <a href="#" class="tooltip-tiny" data-toggle="tooltip" title="A small tooltip">Tooltip</a> <a href="#" class="tooltip-large" data-toggle="tooltip" title="A large tooltip that displayed instantly on mouse hover but hide after 2000 milliseconds.">Large tooltip</a> </p> </div> </body> </html>