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 Tooltips Using jQuery</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"></script> <style> /* Some custom styles to beautify this example */ .bs-example{ margin: 100px 50px; } .bs-example a{ margin: 50px; } </style> <script> $(document).ready(function(){ // Showing and hiding tooltip with same speed $("#tinyTooltip").tooltip({ delay: 100 // show, hide tooltip after 100 milliseconds }); // Showing and hiding tooltip with different speed $("#largeTooltip").tooltip({ delay: {show: 0, hide: 2000} }); }); </script> </head> <body> <div class="bs-example"> <p> <a href="#" id="tinyTooltip" data-bs-toggle="tooltip" title="A small tooltip">Tooltip</a> <a href="#" id="largeTooltip" data-bs-toggle="tooltip" title="A large tooltip that displayed instantly on mouse hover but hide after 2000 milliseconds.">Large tooltip</a> </p> </div> </body> </html>