您能给我看一下这个演示,让我知道如何将hoverIntent jQuery Plugin与Bootstrap工具提示一起使用(仅当鼠标停在按钮上而不是经过按钮时才显示工具提示)>
$(function() {
$(".btn").hoverIntent(
$('[data-toggle="tooltip"]').tooltip()
);
})
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.hoverintent/1.9.0/jquery.hoverIntent.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<div class="container">
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="top" title="Tooltip on top">
Tooltip on top
</button>
</div>
答案 0 :(得分:0)
根据shalan.com的帖子进行了修改,请尝试以下操作:
var config = {
over : function(){ $(this).fadeIn('fast'); }, //appear gradually
out : function(){ $(this).fadeOut('fast'); }, //disappear gradually
timeout : 100 };
$("button[data_toggle='tooltip']").hoverIntent( config );