gpt4 book ai didi

javascript - jquery.ui 工具提示 : Show tooltip only after hover for a duration of time

转载 作者:行者123 更新时间:2023-11-29 19:03:54 25 4
gpt4 key购买 nike

只有当我将鼠标保持在那里 1 秒钟时,我才想在元素上显示工具提示。如果我悬停的时间少于 1 秒,则工具提示不应显示。我该如何实现?

最佳答案

您可以简单地设置我在 docs 中找到的 delay 参数
代码可能看起来像这样

$(document).ready(function() {
$('.selector').tooltip({
show: { effect: 'slideDown', delay: 1000, duration: 250 }
});
});
<link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>

<a href="#" class="selector" title="Tooltip with delay and duration">TEST</a>

关于javascript - jquery.ui 工具提示 : Show tooltip only after hover for a duration of time,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44450116/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com