gpt4 book ai didi

Jquery 工具工具提示不会消失

转载 作者:行者123 更新时间:2023-11-30 23:56:32 25 4
gpt4 key购买 nike

我有一个工具提示,它将显示在任何带有标题的内容上:

$("[title!=]:not(IFRAME)").tooltip();

我有一个可以添加或删除的人员列表,您单击该人员上方的删除按钮,然后单击该按钮将该人替换为另一个人。

当您单击“删除”按钮时,会显示工具提示,因为该项目具有 .但是一旦你换掉那个人,工具提示就不会消失。

我很确定原因是一旦那个人被删除,你就没有鼠标悬停,所以工具提示永远不会消失。

我尝试过这个:

$('.remove-player-large a').click(function() {
$("[title!=]:not(IFRAME)").tooltip().hide();
});

但运气不好关于如何解决这个问题有什么建议吗?

这有道理吗?

最佳答案

您可以使用 hideTooltip() 函数隐藏工具提示。

var $tooltip = null;
$(function(){
$tooltip = $("input[type='text']").tooltip({
// place tooltip on the right edge
position: "center right",
// a little tweaking of the position
offset: [-2, 10],
// use the built-in fadeIn/fadeOut effect
effect: "fade",
// custom opacity setting
opacity: 0.6
});
$("#close").click(function(){
hideTooltip();
});
});
function hideTooltip()
{
if($tooltip)
{
$tooltip.each(function(index){
var $this = $(this).data('tooltip');
if($this.isShown(true))
$this.hide();
});
}
}

关于Jquery 工具工具提示不会消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5668361/

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